cubecart / v6

CubeCart Version 6
https://cubecart.com
72 stars 59 forks source link

Code Review: Use of currentPage() When Calling addBreadCrumb() #3454

Open bhsmither opened 9 months ago

bhsmither commented 9 months ago

In Catalogue->displayProduct(), there is this:

$GLOBALS['gui']->addBreadcrumb($product['name'], currentPage());

By using currentPage(), the result is an SEO'd path.

Note that in GUI->addBreadCrumb(), when pushing arrays onto $this->_breadcrumb, the 'url' gets SEO'd.

Request that the standard querystring be passed in, or perhaps the $_GET array.

The intent is, in addBreadCrumb(), to use parts of $href for more work.

bhsmither commented 9 months ago

The same request applies toCubeCart->loadPage(), near line 392, regarding the breadcrumb for a document.

bhsmither commented 7 months ago

But be careful. Testing against PCRE_REQUEST_URI (replicated as an actual regex) requires [\w]+\.[a-z]+ (such as index.php), which will not be in $_GET.