From 8539ecb93dd7beaa4c422859baf233f0478f00d9 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Sun, 20 May 2018 10:51:34 -0400 Subject: [PATCH] Don't require trailing slash in PSR-4 autoloader directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This avoids the confusing error “Fatal error: Uncaught InvalidArgumentException” or similar. Bug: T195211 Change-Id: Ifda59a26f8bd968a2d0acbdb157d81dc0bf6aab4 (cherry picked from commit 3b85e362a4098832a08529adc89571a86bf6e9a2) --- includes/AutoLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 52410fede8..6e7705653f 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -82,7 +82,7 @@ class AutoLoader { if ( isset( self::$psr4Namespaces[$prefix] ) ) { $relativeClass = substr( $className, $pos + 1 ); // Build the expected filename, and see if it exists - $file = self::$psr4Namespaces[$prefix] . + $file = self::$psr4Namespaces[$prefix] . '/' . str_replace( '\\', '/', $relativeClass ) . '.php'; if ( file_exists( $file ) ) { $filename = $file; -- 2.20.1