Skip to content

Commit a7a9281

Browse files
Update Document.php
1 parent 893d774 commit a7a9281

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
@@ -144,9 +144,15 @@ public function isFrontendEditing()
144144

145145
public function _cssPath($file)
146146
{
147+
$site_path = parse_url(\JURI::root(), PHP_URL_PATH);
148+
149+
if (Helper::startsWith($file, $site_path)) {
150+
$file = preg_replace('/' . preg_quote($site_path, '/') . '/', '/', $file, 1);
151+
}
152+
147153
$file_info = parse_url($file);
148154
if (isset($file_info['host'])) {
149-
if ($file_info['host'] == parse_url(\JURI::root())['host']) {
155+
if ($file_info['host'] == parse_url(\JURI::root(), PHP_URL_HOST)) {
150156
$file = strtok($file, '?');
151157
$file = str_replace(\JURI::root(), '', $file);
152158
return $file;

0 commit comments

Comments
 (0)