mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-71706 core: use reflection to get directory of SCSS import.
This change is required to preserve existing validation of import paths from a76b0b8b, since upgrading ScssPhp to 1.10.0. See scssphp/scssphp@deba6fa4 for corresponding change that means the current directory is no longer assumed when resolving paths.
This commit is contained in:
parent
bd854aa792
commit
944a68ae56
@ -161,7 +161,12 @@ class core_scss extends \ScssPhp\ScssPhp\Compiler {
|
||||
list(, $rawpath) = $child;
|
||||
$rawpath = $this->reduce($rawpath);
|
||||
$path = $this->compileStringContent($rawpath);
|
||||
if ($path = $this->findImport($path)) {
|
||||
|
||||
// We need to find the import path relative to the directory of the currently processed file.
|
||||
$currentdirectory = new ReflectionProperty(\ScssPhp\ScssPhp\Compiler::class, 'currentDirectory');
|
||||
$currentdirectory->setAccessible(true);
|
||||
|
||||
if ($path = $this->findImport($path, $currentdirectory->getValue($this))) {
|
||||
if ($this->is_valid_file($path)) {
|
||||
return parent::compileChild($child, $out);
|
||||
} else {
|
||||
|
@ -222,7 +222,7 @@
|
||||
<location>scssphp</location>
|
||||
<name>scssphp</name>
|
||||
<license>MIT</license>
|
||||
<version>1.4.1</version>
|
||||
<version>1.10.0</version>
|
||||
</library>
|
||||
<library>
|
||||
<location>spout</location>
|
||||
|
Loading…
x
Reference in New Issue
Block a user