Update ps_menutoplinks.class.php
Remove appending "http://" to custom links. Now it's possible to create relative links.
This commit is contained in:
@@ -67,16 +67,6 @@ class Ps_MenuTopLinks
|
|||||||
return array('link' => $link, 'label' => $label, 'new_window' => $new_window);
|
return array('link' => $link, 'label' => $label, 'new_window' => $new_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function updateUrl($link)
|
|
||||||
{
|
|
||||||
for($i = 1; $i <= count($link); $i++) {
|
|
||||||
if (substr($link[$i], 0, 7) !== "http://" && substr($link[$i], 0, 8) !== "https://") {
|
|
||||||
$link[$i] = "http://" . $link[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function add($link, $label, $newWindow = 0, $id_shop)
|
public static function add($link, $label, $newWindow = 0, $id_shop)
|
||||||
{
|
{
|
||||||
if (!is_array($label)) {
|
if (!is_array($label)) {
|
||||||
@@ -86,7 +76,6 @@ class Ps_MenuTopLinks
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = self::updateUrl($link);
|
|
||||||
Db::getInstance()->insert(
|
Db::getInstance()->insert(
|
||||||
'linksmenutop',
|
'linksmenutop',
|
||||||
array(
|
array(
|
||||||
@@ -123,7 +112,6 @@ class Ps_MenuTopLinks
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = self::updateUrl($link);
|
|
||||||
Db::getInstance()->update(
|
Db::getInstance()->update(
|
||||||
'linksmenutop',
|
'linksmenutop',
|
||||||
array(
|
array(
|
||||||
|
|||||||
Reference in New Issue
Block a user