Dirty Butter Posted December 29, 2015 Share Posted December 29, 2015 (edited) I'm getting a backslash when I search for Carter's - I don't remember that happening previous to 6.0.8, but maybe it was doing it previously and I just didn't notice it.Products found matching 'carter\'s'. Is this a case of incorrectly merging my code with 6.0.8?cubecart.class.php if (isset($_REQUEST['search']) && is_array($_REQUEST['search'])) { if (!$GLOBALS['catalogue']->searchCatalogue($_REQUEST['search'], $page, $catalogue_products_per_page)) { // BSMITHER ORIGINAL NOT FOUND SEARCH RESULTS REPLACED WITH "FOUND" CODE SO SEARCH ATTEMPT SHOWS FOR CUSTOMER //$GLOBALS['catalogue']->setCategory('cat_name', $GLOBALS['language']->navigation['search_results']); $GLOBALS['catalogue']->setCategory('cat_name', sprintf($GLOBALS['language']->catalogue['notify_product_search'],$_REQUEST['search']['keywords'])); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->common['search'], 'index.php?_a=search'); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->navigation['search_results'], currentPage()); $GLOBALS['gui']->setError($GLOBALS['language']->catalogue['error_search_no_results']); } else { $GLOBALS['catalogue']->setCategory('cat_name', sprintf($GLOBALS['language']->catalogue['notify_product_search'], htmlspecialchars($_REQUEST['search']['keywords']))); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->common['search'], 'index.php?_a=search'); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->navigation['search_results'], currentPage()); } Edited December 31, 2015 by Dirty Butter Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 31, 2015 Author Share Posted December 31, 2015 Still no replies - How can I get rid of the backslash? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 31, 2015 Share Posted December 31, 2015 You can try making this edit (in two places):From just this part:$_REQUEST['search']['keywords']To:stripslashes($_REQUEST['search']['keywords'])I also think the first occurrence of this part:catalogue['notify_product_search'],$_REQUEST['search']['keywords']));should be like the code of the second part:catalogue['notify_product_search'],htmlspecialchars($_REQUEST['search']['keywords']))); Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 31, 2015 Author Share Posted December 31, 2015 I had realized I needed to add the htmlspecialchars part, but had no idea how to add the stripslashes correctly. Thanks!NOW// BSMITHER ORIGINAL NOT FOUND SEARCH RESULTS REPLACED WITH "FOUND" CODE SO SEARCH ATTEMPT SHOWS FOR CUSTOMER //$GLOBALS['catalogue']->setCategory('cat_name', $GLOBALS['language']->navigation['search_results']); $GLOBALS['catalogue']->setCategory('cat_name', sprintf($GLOBALS['language']->catalogue['notify_product_search'],$_REQUEST['search']['keywords'])); $GLOBALS['catalogue']->setCategory('cat_name', sprintf($GLOBALS['language']->catalogue['notify_product_search'], htmlspecialchars(stripslashes($_REQUEST['search']['keywords'])))); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->navigation['search_results'], currentPage()); $GLOBALS['gui']->setError($GLOBALS['language']->catalogue['error_search_no_results']); } else { $GLOBALS['catalogue']->setCategory('cat_name', sprintf($GLOBALS['language']->catalogue['notify_product_search'], htmlspecialchars(stripslashes($_REQUEST['search']['keywords'])))); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->common['search'], 'index.php?_a=search'); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->navigation['search_results'], currentPage()); } May you have a wonderful 2016, @Bsmither !! You certainly deserve it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.