Unlike the store-side zen_href_link function, the admin zen_catalog_href_link function doesn't clean-up the generated link, removing double ampersands (whether && or &&) nor does it convert the base ampersands in the link to &. This results in the generation of HTML emails that don't pass the w3c validator.
To correct the issue, I modified /YOUR_ADMIN/includes/functions/html_output.php's zen_catalog_href_link function as follows (inserted code highlighted):
Code:
function zen_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
if ($connection == 'NONSSL') {
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL_CATALOG == 'true') {
$link = HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG;
} else {
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
}
} else {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>zen_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
if ($parameters == '') {
$link .= 'index.php?main_page='. $page;
} else {
$link .= 'index.php?main_page='. $page . "&" . zen_output_string($parameters);
}
while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
//-bof-20150901-lat9-Add link clean-up, copied from store-side zen_href_link function
// clean up the link before processing
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') ) {
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
$link = str_replace('&', '/', $link);
$link = str_replace('?', '/', $link);
$link = str_replace('&', '/', $link);
$link = str_replace('=', '/', $link);
$separator = '?';
}
// clean up the link after processing
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
$link = preg_replace('/&/', '&', $link);
//-eof-20150901-lat9
return $link;
}
Bookmarks