Skip to content
Snippets Groups Projects
Unverified Commit f29ceb64 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3259110 by longwave, mglaman: Fix undefined variables where files are included

parent 6470ab79
No related branches found
No related tags found
No related merge requests found
......@@ -283,12 +283,10 @@ protected function readLanguageOverrides($langcode) {
// Read in this file, which should set up a variable called $overrides,
// which will be local to this function.
$overrides[$langcode] = [];
if (is_file($file)) {
include $file;
}
if (!isset($overrides) || !is_array($overrides)) {
$overrides = [$langcode => []];
}
$this->languageOverrides[$langcode] = $overrides[$langcode];
}
......@@ -311,14 +309,10 @@ protected function readGenericData($bank) {
// Read in this file, which should set up a variable called $base, which
// will be local to this function.
$base = [];
if (is_file($file)) {
include $file;
}
if (!isset($base) || !is_array($base)) {
$base = [];
}
// Save this data.
$this->genericMap[$bank] = $base;
}
......
......@@ -132,6 +132,7 @@ function color_get_info($theme) {
$path = \Drupal::service('extension.list.theme')->getPath($theme);
$file = \Drupal::root() . '/' . $path . '/color/color.inc';
if ($path && file_exists($file)) {
$info = [];
include $file;
// Add in default values.
$info += [
......
......@@ -20,16 +20,6 @@ parameters:
count: 1
path: includes/update.inc
-
message: "#^Undefined variable\\: \\$base$#"
count: 1
path: lib/Drupal/Component/Transliteration/PhpTransliteration.php
-
message: "#^Undefined variable\\: \\$overrides$#"
count: 1
path: lib/Drupal/Component/Transliteration/PhpTransliteration.php
-
message: "#^Call to method getDefinitions\\(\\) on an unknown class Drupal\\\\Core\\\\Plugin\\\\CategorizingPluginManagerTrait\\.$#"
count: 3
......@@ -300,11 +290,6 @@ parameters:
count: 1
path: modules/ckeditor5/src/Controller/CKEditor5ImageController.php
-
message: "#^Undefined variable\\: \\$info$#"
count: 1
path: modules/color/color.module
-
message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
count: 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment