IP_CAM wrote: ↑Fri Jul 31, 2020 2:39 am
It's sure not a Bug, you just don't understand the system, as it looks ...
Hello.... let me teach you what I have found out so that you will learn. I am an engineer who also develops complex systems in many programming languages. Since I always need to know the base of a problem instead of trying to patch it to hide the origin of it, I have browsed source code and I have found this is really a bug or maybe developers do that way on purpose, I don't know.
Please open this file:
Code: Select all
\catalog\controller\common\footer.php
If you know how to develop software, you will notice immediately this:
Code: Select all
foreach ($this->model_catalog_information->getInformations() as $result) {
if ($result['bottom']) {
$data['informations'][] = array(
'title' => $result['title'],
'href' => $this->url->link('information/information', 'information_id=' . $result['information_id'])
);
}
}
$data['contact'] = $this->url->link('information/contact');
$data['return'] = $this->url->link('account/return/add', '', true);
$data['sitemap'] = $this->url->link('information/sitemap');
$data['tracking'] = $this->url->link('information/tracking');
$data['manufacturer'] = $this->url->link('product/manufacturer');
$data['voucher'] = $this->url->link('account/voucher', '', true);
$data['affiliate'] = $this->url->link('affiliate/login', '', true);
$data['special'] = $this->url->link('product/special');
$data['account'] = $this->url->link('account/account', '', true);
$data['order'] = $this->url->link('account/order', '', true);
$data['wishlist'] = $this->url->link('account/wishlist', '', true);
$data['newsletter'] = $this->url->link('account/newsletter', '', true);
Do you see the "true" there? well.... that tells the system that the URL is secure, as this other piece of code shows:
Code: Select all
/**
*
*
* @param string $route
* @param mixed $args
* @param bool $secure
*
* @return string
*/
public function link($route, $args = '', $secure = false) {
if ($this->ssl && $secure) {
$url = $this->ssl . 'index.php?route=' . $route;
} else {
$url = $this->url . '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;
}
As you see, third parameter tells if the link is secured or not.
The call should only has a "true" in the third parameter, always. I understand now why some links have https and why others don't.
The fact is that it should be true for all links. If some site does not use SSL, following code will be executed instead, even when the third parameter is true:
Code: Select all
$url = $this->url . 'index.php?route=' . $route;
It seems I understand the system more than you
Regards
Jaime