Skip to content

Commit 41c7d55

Browse files
Update Document.php
1 parent a7a9281 commit 41c7d55

File tree

1 file changed

+7
-1
lines changed
  • astroid/astroid-framework/framework/library/astroid

1 file changed

+7
-1
lines changed

astroid/astroid-framework/framework/library/astroid/Document.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,15 @@ public function _cssPath($file)
170170

171171
public function _jsPath($file)
172172
{
173+
$site_path = parse_url(\JURI::root(), PHP_URL_PATH);
174+
175+
if (Helper::startsWith($file, $site_path)) {
176+
$file = preg_replace('/' . preg_quote($site_path, '/') . '/', '/', $file, 1);
177+
}
178+
173179
$file_info = parse_url($file);
174180
if (isset($file_info['host'])) {
175-
if ($file_info['host'] == parse_url(\JURI::root())['host']) {
181+
if ($file_info['host'] == parse_url(\JURI::root(), PHP_URL_HOST)) {
176182
$file = strtok($file, '?');
177183
$file = str_replace(\JURI::root(), '', $file);
178184
return $file;

0 commit comments

Comments
 (0)