Skip to content

Commit

Permalink
Allow zen_href_link to receive / for home page when $static=true
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte committed Nov 12, 2020
1 parent f0badf4 commit 5f32156
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/classes/breadcrumb.php
Expand Up @@ -53,7 +53,7 @@ function trail($separator = '  ', $prefix = '', $suffix = '')
if (!empty($this->_trail[$i]['link']) && !$skip_link) {
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' ' . $prefix . '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>' . $suffix;
$trail_string .= ' ' . $prefix . '<a href="' . zen_href_link('/', '', 'SSL', false, true, true) . '">' . $this->_trail[$i]['title'] . '</a>' . $suffix;
} else {
$trail_string .= ' ' . $prefix . '<a href="' . $this->_trail[$i]['link'] . '">' . $this->_trail[$i]['title'] . '</a>' . $suffix;
}
Expand Down
5 changes: 3 additions & 2 deletions includes/functions/html_output.php
Expand Up @@ -6,7 +6,7 @@
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: DrByte 2020 Oct 29 Modified in v1.5.7a $
* @version $Id: DrByte 2020 Oct 29 Modified in v1.5.8 $
*/

/*
Expand All @@ -18,7 +18,7 @@ function zen_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad
$zco_notifier->notify('NOTIFY_SEFU_INTERCEPT', array(), $link, $page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);
if($link !== null) return $link;

if (!zen_not_null($page)) {
if (empty($page)) {
trigger_error("zen_href_link($page, $parameters, $connection), unable to determine the page link.",
E_USER_ERROR);
die('</td></tr></table></td></tr></table><br /><br /><strong class="note">Error!<br /><br />Unable to determine the page link!</strong><br /><br /><!--' . $page . '<br />' . $parameters . ' -->');
Expand Down Expand Up @@ -96,6 +96,7 @@ function zen_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad
while (strstr($link, '&amp;&amp;')) $link = str_replace('&amp;&amp;', '&amp;', $link);

$link = preg_replace('/&/', '&amp;', $link);
$link = preg_replace('~//$~', '/', $link);
return $link;
}

Expand Down

0 comments on commit 5f32156

Please sign in to comment.