surcie Posted July 17, 2010 Posted July 17, 2010 Ok i will try to be as thorough as possible, because i have spent days trying to figger this out, and i have done all the solutions in forums to fix unable to determine page link and none works, namely: -> changing tep in html_ouput -> changing application_top page to php_self -> changing .htaccess to register long arrays On -> btw SEO Friendly URLS is turned to false :) So i will describe the problem: When a client enters shopping cart, after a few steps, it returns Error! Unable to determine the page link! (but not at first, only if client leaves cart, and returns for 2nd or 3rd time). Here is my shopping cart php code: (i have installed jQuery/Ajax Shopping Cart but i don't think the issue is due to this) catalog/shopping_cart.php <?php /* $Id: shopping_cart.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2007 osCommerce Released under the GNU General Public License */ require("includes/application_top.php"); if ($cart->count_contents() > 0) { include(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment; } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART,'','SSL')); /* BOF code added jQuery Shopping Cart - by delete */ // Request from jQuery // if ( isset($_GET['show_total']) && (int)$_GET['ajax'] ) { echo $currencies->format($cart->show_total()) ; die ; } if ( (int)$_GET['ajax'] != 1 && $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest' ) { /* EOF code added jQuery Shopping Cart */ ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <!--BOF code replace contrib kissmtS is available !--> <?php include_once DIR_WS_MODULES . 'kiss_meta_tags/kiss_meta_tags.php'; ?> <!--EOF code replace contrib kissmtS is available !--> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <!--// BOF code added JQuery Shopping Cart V1.0 ---> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <!--// EOF code added JQuery Shopping Cart V1.0 ---> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <!--//BOF code replace Jquery Shopping CartV1.0--> <td width="100%" valign="top"> <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?> <?php // end of XMLHttpRequest condition } else { header("Content-Type:text/html; charset=' . CHARSET . '"); } ?> <div id="content-body"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <!--//EOF code replace Jquery Shopping CartV1.0--> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_cart.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($cart->count_contents() > 0) { ?> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_REMOVE); $info_box_contents[0][] = array('params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_PRODUCTS); $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_QUANTITY); $info_box_contents[0][] = array('align' => 'right', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_TOTAL); $any_out_of_stock = 0; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { // Push all attributes information in an array if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { while (list($option, $value) = each($products[$i]['attributes'])) { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'"); $attributes_values = tep_db_fetch_array($attributes); $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name']; $products[$i][$option]['options_values_id'] = $value; $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name']; $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price']; $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix']; } } } for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (($i/2) == floor($i/2)) { $info_box_contents[] = array('params' => 'class="productListing-even"'); } else { $info_box_contents[] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($info_box_contents) - 1; //BOF code replace Jquery Shopping CartV1.0 $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="middle"', 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']) . '<a class="cart-remove" style="visibility:hidden;" href="#" rel="' . $products[$i]['id'] . '">' . tep_image(DIR_WS_ICONS . 'cancel.png', TABLE_HEADING_REMOVE) . '</a>' . '<span style="display:none;" id="pn-' . $products[$i]['id'] . '">' . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . $products[$i]['name'] . '</a></span>') ; //EOF code replace Jquery Shopping CartV1.0 $products_name = '<table border="0" cellspacing="2" cellpadding="2">' . ' <tr>' . ' <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . ' <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>'; if (STOCK_CHECK == 'true') { $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']); if (tep_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>'; } } $products_name .= ' </td>' . ' </tr>' . '</table>'; $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"', 'text' => $products_name); //BOF code replace Jquery Shopping CartV1.0 $info_box_contents[$cur_row][] = array('params' => 'class="cart-qty" ', 'text' => '<a href="#" class="update-qty moins" style="visibility:hidden;" rel="' . $products[$i]['id'] . '">' . tep_image(DIR_WS_ICONS . 'moins.png') . '</a>' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4" id="pl' . $products[$i]['id'] . '"' ) . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . '<a href="#" class="update-qty plus" style="visibility:hidden;" rel="' . $products[$i]['id'] . '">' . tep_image(DIR_WS_ICONS . 'plus.png') . '</a>'); //EOF code replace Jquery Shopping CartV1.0 $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>'); } new productListingBox($info_box_contents); ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td> </tr> <!-- BOF code added MyContrib quantities infos //!--> <tr> <td class="boxText" align="center"><br><?php echo sprintf(TEXT_ORDER_QUANTITY_INFOS); ?></td> </tr> <!-- EOF code added MyContrib quantities infos //!--> <?php if ($any_out_of_stock == 1) { if (STOCK_ALLOW_CHECKOUT == 'true') { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td> </tr> <?php } else { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td> </tr> <?php } } ?> <!-- BOF Code Added Minimum order amount contribs //!--> <?php // minimum order total if ($cart->show_total() < MIN_ORDER_AMOUNT) { ?> <tr> <td class="stockWarning" align="center"><br><?php echo sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, $currencies->format(MIN_ORDER_AMOUNT)); ?></td> </tr> <?php } ?> <!-- EOF Code Added Minimum order amount contribs //!--> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td> <?php $back = sizeof($navigation->path)-2; if (isset($navigation->path[$back])) { ?> <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td> <?php } ?> <!-- BOF Code replace minimum order amounts contribs //!--> <?php if ($cart->show_total() > MIN_ORDER_AMOUNT) { ?> <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td> <?php } ?> <!-- EOF Code replace minimum order amounts contribs //!--> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <!-- BOF Code replace minimum order amounts contribs //!--> <?php $initialize_checkout_methods = $payment_modules->checkout_initialization_method(); if (!empty($initialize_checkout_methods) && ($cart->show_total() > MIN_ORDER_AMOUNT)) { ?> <!-- EOF Code replace minimum order amounts contribs //!--> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td align="right" class="main" style="padding-right: 50px;"><?php echo TEXT_ALTERNATIVE_CHECKOUT_METHODS; ?></td> </tr> <?php reset($initialize_checkout_methods); while (list(, $value) = each($initialize_checkout_methods)) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td align="right" class="main"><?php echo $value; ?></td> </tr> <?php } } } else { ?> <tr> <td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } ?> <!--//BOF code replace Jquery Shopping CartV1.0--> </table> </div> <script type="text/javascript" src="js/jquery-oscart.js"></script> <?php if ( (int)$_GET['ajax'] != 1 && $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest' ) { ?> </form> </td> <!--//EOF code replace Jquery Shopping CartV1.0--> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> <?php /* BOF code added jQuery Shopping Cart - by delete */ } // end of XMLHttpRequest condition else { header("Content-Type:text/html; charset=' . CHARSET . '"); } /* EOF code added jQuery Shopping Cart - by delete */ ?> KissError Handler reports: Error: Undefined index: ajax File: shopping_cart.php Line: 34 Error: Undefined index: HTTP_X_REQUESTED_WITH File: shopping_cart.php Line: 34 Line 34: if ( (int)$_GET['ajax'] != 1 && $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest' ) Error: Undefined index: ajax File: shopping_cart.php Line: 332 Error: Undefined index: HTTP_X_REQUESTED_WITH File: shopping_cart.php Line: 332 Line 332: if ( (int)$_GET['ajax'] != 1 && $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest' ) Any help is welcome, if forums won't do it, i will rollback some patches.
surcie Posted July 18, 2010 Author Posted July 18, 2010 Well this is quite annoying, i have uninstalled most contribs related to shopping cart, and still i got the Error! Unable to determine page link on shopping cart, when i return to it (if it has items). Spooks, FWR, Jack_Mcs, Dunweb, MrPhill lool and other most active and experienced members here, can someone shed an answer ... really apreciating here... Thanks in advance
surcie Posted July 21, 2010 Author Posted July 21, 2010 Since noone replyed so far... i was able to scrutinize the error... it is in application_top.php if i replace the file with a default one it works. The contributions installed are USU5 so if anyone knows replies are appreciated thanks.
mirko007 Posted July 21, 2010 Posted July 21, 2010 ops double post heree. Try this one: Edit file: includes/functions/html_output.php find: function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $request_type, $session_started, $SID; if (!tep_not_null($page)) { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>'); } change to: function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $request_type, $session_started, $SID, $HTTP_SERVER_VARS; if (!tep_not_null($page)) { $page = basename($HTTP_SERVER_VARS['PHP_SELF']); } I hope it will help
surcie Posted July 21, 2010 Author Posted July 21, 2010 Hello mirko007, First of all thank you very much for triyng to help me, you are the first one to bother replying me, and this problem is really delaying all of my work... it is related i am sure to USU5 installation and that line in html_ouput has the following: // ULTIMATE Seo Urls 5 by FWR Media // The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls, $languages_id, $request_type, $session_started, $sid; if ( !is_object($seo_urls) ){ include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php'; $seo_urls = new usu($languages_id, $request_type, $session_started, $sid); } return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } // EOF Ultimate SEO5 by FW//// so basically i shouldn't change it or else the URL rewriter contrib won't wrok sitewide. If you care to ellaborate further and try to solve my issue i would be so much thankfull... i am already thankfull for your reply ... cheers
mirko007 Posted July 21, 2010 Posted July 21, 2010 Hello mirko007, First of all thank you very much for triyng to help me, you are the first one to bother replying me, and this problem is really delaying all of my work... it is related i am sure to USU5 installation and that line in html_ouput has the following: // ULTIMATE Seo Urls 5 by FWR Media // The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls, $languages_id, $request_type, $session_started, $sid; if ( !is_object($seo_urls) ){ include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php'; $seo_urls = new usu($languages_id, $request_type, $session_started, $sid); } return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } // EOF Ultimate SEO5 by FW//// so basically i shouldn't change it or else the URL rewriter contrib won't wrok sitewide. If you care to ellaborate further and try to solve my issue i would be so much thankfull... i am already thankfull for your reply ... cheers Ok then I have a little more information to help you I don't use this addon so don't forgeto make backup!!! I downloaded SEO5 to find for you good part of code to change and I've got it (I hope) :) find in includes/modules/ultimate_seo_urls5/includes/Usu_General_Functions.php code: function osc_href_link( $page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true ) { if ( !tep_not_null( $page ) ) { die( '</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>' ); } change to: function osc_href_link( $page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true ) { if (!tep_not_null($page)) { $page = basename($HTTP_SERVER_VARS['PHP_SELF']); } I hope now it will help :)
surcie Posted July 21, 2010 Author Posted July 21, 2010 Hello mirko007, First of all thank you very much for triyng to help me, you are the first one to bother replying me, and this problem is really delaying all of my work... it is related i am sure to USU5 installation and that line in html_ouput has the following: // ULTIMATE Seo Urls 5 by FWR Media // The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls, $languages_id, $request_type, $session_started, $sid; if ( !is_object($seo_urls) ){ include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php'; $seo_urls = new usu($languages_id, $request_type, $session_started, $sid); } return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } // EOF Ultimate SEO5 by FW//// so basically i shouldn't change it or else the URL rewriter contrib won't wrok sitewide. If you care to ellaborate further and try to solve my issue i would be so much thankfull... i am already thankfull for your reply ... cheers OK i think we are getting somewhere... I blended your suggestion in the code with the contribution USU5 i had from FWR: A - in global, added $HTTP_SERVER_VARS after $sid B - After the if clause, added else clause with your code... RESULTS: // ULTIMATE Seo Urls 5 by FWR Media slightly changed with mirko007 code from forums // The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls, $languages_id, $request_type, $session_started, $sid, $HTTP_SERVER_VARS; if ( !is_object($seo_urls) ){ include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php'; $seo_urls = new usu($languages_id, $request_type, $session_started, $sid); } //added else { if (!tep_not_null($page)) { $page = basename($HTTP_SERVER_VARS['PHP_SELF']); } } //added return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } // EOF Ultimate SEO5 by FW//// And... voilá... it's working, the cart isn't displaying Error anymore. But i am a bit suspicious about if with this change USU5 still work, and the using of HTTP_SERVER_VARS and PHP_SELF isn't a security issue. I am really not a guru in php, and i only changes this to meet logic, but i don't know what this will do in terms of coding. Can you explain me?! Thanks for your answer, i think now i'm moving towards the resolution of this bug.
mirko007 Posted July 21, 2010 Posted July 21, 2010 OK i think we are getting somewhere... I blended your suggestion in the code with the contribution USU5 i had from FWR: A - in global, added $HTTP_SERVER_VARS after $sid B - After the if clause, added else clause with your code... RESULTS: // ULTIMATE Seo Urls 5 by FWR Media slightly changed with mirko007 code from forums // The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls, $languages_id, $request_type, $session_started, $sid, $HTTP_SERVER_VARS; if ( !is_object($seo_urls) ){ include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php'; $seo_urls = new usu($languages_id, $request_type, $session_started, $sid); } //added else { if (!tep_not_null($page)) { $page = basename($HTTP_SERVER_VARS['PHP_SELF']); } } //added return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } // EOF Ultimate SEO5 by FW//// And... voilá... it's working, the cart isn't displaying Error anymore. But i am a bit suspicious about if with this change USU5 still work, and the using of HTTP_SERVER_VARS and PHP_SELF isn't a security issue. I am really not a guru in php, and i only changes this to meet logic, but i don't know what this will do in terms of coding. Can you explain me?! Thanks for your answer, i think now i'm moving towards the resolution of this bug. I suggest to try change like I told you in post above
surcie Posted July 21, 2010 Author Posted July 21, 2010 If i cut up the html link wrapper and put the code you told me... i will loose usu5 contribution... Can you be more detailed, if the middle solution i have came up with is working why in your opinion i should cut out the usu5 code?
mirko007 Posted July 21, 2010 Posted July 21, 2010 If i cut up the html link wrapper and put the code you told me... i will loose usu5 contribution... Can you be more detailed, if the middle solution i have came up with is working why in your opinion i should cut out the usu5 code? Read all my posts I told you where change code in SEO5 you will not loose anything
surcie Posted July 21, 2010 Author Posted July 21, 2010 Read all my posts I told you where change code in SEO5 you will not loose anything Oh... lol ... you are right, i replyed so fast i haven't seen your 2nd suggestion. Right, i have undone 1st suggestion and implemented 2nd, so basically the semantics: In case any link (href_link) is used in the shop, the function osc_href_link is executed, and then if !tep_not_null, then the error is not displayed. Basically what we have done here is to hide the error, not sort it... am i right? Instead of replacing in Usu_Generall_functions.php: die( '</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>' ); for $page = basename($HTTP_SERVER_VARS['PHP_SELF']); i comment out //die( '</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>'); And it doesn't display the error anymore... do you think the replace is really necessary?? Because that line using HTTP_SERVER_VARS['PHP_SELF'] is a bit unsecure isn't it??
mirko007 Posted July 21, 2010 Posted July 21, 2010 Oh... lol ... you are right, i replyed so fast i haven't seen your 2nd suggestion. Right, i have undone 1st suggestion and implemented 2nd, so basically the semantics: In case any link (href_link) is used in the shop, the function osc_href_link is executed, and then if !tep_not_null, then the error is not displayed. Basically what we have done here is to hide the error, not sort it... am i right? Instead of replacing in Usu_Generall_functions.php: die( '</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>' ); for $page = basename($HTTP_SERVER_VARS['PHP_SELF']); i comment out //die( '</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>'); And it doesn't display the error anymore... do you think the replace is really necessary?? Because that line using HTTP_SERVER_VARS['PHP_SELF'] is a bit unsecure isn't it?? You do not have to worry about security, if you have register_globals set to off you can use it safely commenting out is not good idea.
surcie Posted July 21, 2010 Author Posted July 21, 2010 Sorry for having so many newbie questions... i think i have register globals on, and for what i recall a good script of osc has registers globals on, and what is the meaning of enforcing $page value? will it fix an undefined variable or index error?
♥FWR Media Posted July 21, 2010 Posted July 21, 2010 tep_href_link() is designed to accept the following input: - tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) $page should be a filename ( e.g. index.php ) $parameters _GET key value pairs $connection SSL or NON_SSL $add_session_id bool true/false $search_engine_safe ( we'll ignore :) ) USU5 does not rely on or use at all PHP_SELF because it is unreliable .. it is universally available .. but unreliable ( ref: the admin hack caused by its use ) basename( $SOME_LONG_ARRAY['PHP_SELF'] does not always return a filename ). USU5 goes through a load of checks to ensure it is a correct and valid file name. Many contributions out there use $page to pass something other than a file name which in my opinion is incorrect. like image links .. tep_href_link( $page = 'images/image.jpg' ) USU5 would ( in my opinion correctly .. reject this as it is not a valid page ). No I would not put in USU5 code deprecated long arrays and PHP_SELF I would correct the code that is incorrectly using the link wrapper. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
surcie Posted July 21, 2010 Author Posted July 21, 2010 tep_href_link() is designed to accept the following input: - tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) $page should be a filename ( e.g. index.php ) $parameters _GET key value pairs $connection SSL or NON_SSL $add_session_id bool true/false $search_engine_safe ( we'll ignore :) ) USU5 does not rely on or use at all PHP_SELF because it is unreliable .. it is universally available .. but unreliable ( ref: the admin hack caused by its use ) basename( $SOME_LONG_ARRAY['PHP_SELF'] does not always return a filename ). USU5 goes through a load of checks to ensure it is a correct and valid file name. Many contributions out there use $page to pass something other than a file name which in my opinion is incorrect. like image links .. tep_href_link( $page = 'images/image.jpg' ) USU5 would ( in my opinion correctly .. reject this as it is not a valid page ). No I would not put in USU5 code deprecated long arrays and PHP_SELF I would correct the code that is incorrectly using the link wrapper. Hmm, thank you very much Rob for this explanation to a newbie [copies the last reply to a self mantained knowledgebase file] :) I think i will for now just comment out the line that outputs the error (without adding the $page code line), so basically im taking out the error report line, since is possible and works client side, still with some errors but nothing that affects the buying process or security of the overall shop in this case). Thanks all
Recommended Posts
Archived
This topic is now archived and is closed to further replies.