Skip to content

Commit a79442f

Browse files
attribmglaman
authored andcommitted
Prevent double require of files
1 parent beb7e4a commit a79442f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Drupal/Bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ protected function loadLegacyIncludes(): void
145145
{
146146
/** @var \SplFileInfo $file */
147147
foreach (Finder::findFiles('*.inc')->in($this->drupalRoot . '/core/includes') as $file) {
148-
require $file->getPathname();
148+
require_once $file->getPathname();
149149
}
150150
}
151151

@@ -231,7 +231,7 @@ protected function loadExtension(Extension $extension): void
231231
protected function loadAndCatchErrors(string $path): void
232232
{
233233
try {
234-
require $path;
234+
require_once $path;
235235
} catch (ContainerNotInitializedException $e) {
236236
$path = str_replace(dirname($this->drupalRoot) . '/', '', $path);
237237
// This can happen when drupal_get_path or drupal_get_filename are used outside of the scope of a function.

0 commit comments

Comments
 (0)