Skip to content

Instantly share code, notes, and snippets.

@ajbonner
Created August 30, 2012 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajbonner/3524039 to your computer and use it in GitHub Desktop.
Save ajbonner/3524039 to your computer and use it in GitHub Desktop.
Unescaped input in breadcrumbs - Magento 1.6.x Mage_CatalogSearch_Block_Result
/**
* Prepare layout
*
* @return Mage_CatalogSearch_Block_Result
*/
protected function _prepareLayout()
{
// add Home breadcrumb
$breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
if ($breadcrumbs) {
$title = $this->__("Search results for: '%s'", $this->helper('catalogsearch')->getQueryText());
$breadcrumbs->addCrumb('home', array(
'label' => $this->__('Home'),
'title' => $this->__('Go to Home Page'),
'link' => Mage::getBaseUrl()
))->addCrumb('search', array(
'label' => $title,
'title' => $title
));
}
// modify page title
$title = $this->__("Search results for: '%s'", $this->helper('catalogsearch')->getEscapedQueryText());
$this->getLayout()->getBlock('head')->setTitle($title);
return parent::_prepareLayout();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment