From 8ead4a5e727eecda323a88be474c04b331a10fd4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no>
Date: Tue, 20 Nov 2018 11:25:49 +0100
Subject: [PATCH] Use substr() instead of preg_match() when no preg is actually
 used.

---
 lib/SimpleSAML/Module.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index 2b6604ad0..707db09c5 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -220,7 +220,7 @@ class Module
             throw new Error\NotFound('The URL wasn\'t found in the module.');
         }
 
-        if (preg_match('#\.php$#D', $path)) {
+        if (substr($path, -4) === '.php') {
             // PHP file - attempt to run it
 
             /* In some environments, $_SERVER['SCRIPT_NAME'] is already set with $_SERVER['PATH_INFO']. Check for that
-- 
GitLab