Issue Bug Closed

#51189Remove non-needed Url parameter for standard search

Thomas Skierlo 08/19/13, 16:42 updated 10/23/17, 21:47

Description

Currently (6.1.3/6.2.0alpha2) an Url parameter is set in any case, if you toggle the standard/advanced search switch. This parameter should only be set in case of advanced search to prevent duplicate content, speaking url headaches and overloaded urls. Patch tested with bilingual content.

In SearchFormController.php, starting from line 1425:

        if ($this->conf['show.']['advancedSearchLink']) {
//            $linkToOtherMode = $this->piVars['ext'] ? $this->pi_getPageLink($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sPre, array($this->prefixId . '[ext]' => 0)) : $this->pi_getPageLink($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sPre, array($this->prefixId . '[ext]' => 1));
            $linkToOtherMode = $this->piVars['ext'] ? $this->pi_getPageLink($GLOBALS['TSFE']->id) : $this->pi_getPageLink($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sPre, array($this->prefixId . '[ext]' => 1));
            $markerArray['###LINKTOOTHERMODE###'] = '<a href="' . htmlspecialchars($linkToOtherMode) . '">' . $this->pi_getLL(($this->piVars['ext'] ? 'link_regularSearch' : 'link_advancedSearch'), '', 1) . '</a>';
        } else {
            $markerArray['###LINKTOOTHERMODE###'] = '';
        }

p.s. sorry for not providing a patch file – don’t know how to do it.

Reviews 4