Skip to content
Snippets Groups Projects
Commit 0bfe9003 authored by Laurent's avatar Laurent
Browse files

Merge branch 'hotline_#23756_absolute_url_root_mode' into hotline-master

parents b0c273cd ccda7c7c
Branches
Tags
2 merge requests!896Master,!850Master
- ticket #23756 : Correction des liens de différents bouttons qui posaient problèmes pour les Bokeh installé en mode racine.
\ No newline at end of file
......@@ -67,7 +67,6 @@ class Class_CmsUrlTransformer {
}
return static::removeHost($hostname,$basedir, $contents, $replace_count);
}
......
......@@ -68,12 +68,15 @@ class Class_Url {
public function absoluteUrl($url_array_or_string = [], $name = null, $reset = false, $encode = true) {
$url = $this->prepare($url_array_or_string, $name, $reset, $encode);
if (preg_match('/http[s]?:\/\//', $url))
return $url;
if ((!static::$_do_not_add_base_url) && BASE_URL && (0 !== strpos($url, BASE_URL)))
$url = BASE_URL . ($url[0] == '/' ? $url : '/'.$url);
$url = ($url[0] == '/' ? $url : '/'.$url);
return 'http://' . $_SERVER['SERVER_NAME'] . $url;
}
......
storm @ 4463df0e
Subproject commit 51910ea44aede08d3d1607ef9fb4e7b955659339
Subproject commit 4463df0eb2a3b40f9fa3ca648838bc2865bb710b
......@@ -56,6 +56,11 @@ class UrlBaseUrlTest extends PHPUnit_Framework_TestCase {
Class_Url::baseUrl());
}
}
?>
\ No newline at end of file
/** @test */
public function absoluteUrlShouldReturnCorrectSyntax() {
$this->assertContains('http://' . $_SERVER['SERVER_NAME'] . '/', Class_Url::absolute(['module' => 'admin',
'controller' => 'cms',
'action' => 'index']));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment