Skip to content

Commit df682d1

Browse files
anny21Krinkle
authored andcommitted
Less_ImportVisitor: Fix "Using null as an array offset" PHP 8.5 warning
In less.js, they do something like "fullPath in importVisitor.recursionDetector" which is kind of the equivalent to array_key_exists. We would also still encounter this error if we use array_key_exists because less.js also passes in null to the function. These values are set in ImportManager.prototype.push and if you narrow down, the actual callback is ImportVisitor.prototype.onImported. Bug: T411400 Change-Id: I4ad03834f87e01ae316494fab1f8205480722f46
1 parent 00aa3e1 commit df682d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Less/ImportVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function processImportNode( $importNode, $env, &$importParent ) {
164164
throw $e;
165165
}
166166

167-
$duplicateImport = isset( $this->recursionDetector[$fullPath] );
167+
$duplicateImport = $fullPath && isset( $this->recursionDetector[$fullPath] );
168168

169169
if ( !$env->importMultiple ) {
170170
if ( $duplicateImport ) {

0 commit comments

Comments
 (0)