It would be great if people could test the new methodology and report the results on their end. On my end, I do not seem to have any issues using the URLs, so far.
In system/library/url.php file, replace the entire: url method code block with this:
Code: Select all
public function link($route, $args = '', $secure = false) {
static $url = '';
if ($this->ssl && $secure && preg_match_all('#\b(https?)://([^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s])|/))#', HTTPS_SERVER, $url_match) && isset($_SERVER['HTTPS']) && (($_SERVER['HTTPS'] == 'on') || ($_SERVER['HTTPS'] == '1'))) {
if (strlen(trim(html_entity_decode($url_match[1][0], ENT_QUOTES, 'UTF-8'))) == 4) {
// Force SSL protocol to match the PCI-Compliance policy.
$url_match[1][0] = 'https';
}
$url = html_entity_decode($url_match[1][0] . '://' . $url_match[2][0], ENT_QUOTES, 'UTF-8') . 'index.php?route=' . $route;
} elseif ((!$this->ssl || !$secure) && preg_match_all('#\b(https?)://([^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s])|/))#', HTTP_SERVER, $url_match)) {
if (strlen(trim(html_entity_decode($url_match[1][0], ENT_QUOTES, 'UTF-8'))) != 4) {
$url_match[1][0] = 'http';
}
$url = html_entity_decode($url_match[1][0] . '://' . $url_match[2][0], ENT_QUOTES, 'UTF-8') . 'index.php?route=' . $route;
}
if ($args) {
if (is_array($args)) {
$url .= '&' . http_build_query($args);
} else {
$url .= str_replace('&', '&', '&' . ltrim($args, '&'));
}
}
foreach ($this->rewrite as $rewrite) {
$url = $rewrite->rewrite($url);
}
return $url;
}