diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index 88692e246174b77fa687edadff4da7b881d04111..861452149012ef84b8efe015a04ea4dc233e55b6 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -250,7 +250,7 @@ class Module
             throw new Error\NotFound('The URL wasn\'t found in the module.');
         }
 
-        if (substr($path, -4) === '.php') {
+        if (mb_strtolower(substr($path, -4), 'UTF-8') === '.php') {
             // PHP file - attempt to run it
 
             /* In some environments, $_SERVER['SCRIPT_NAME'] is already set with $_SERVER['PATH_INFO']. Check for that