check whether $result is a string
authorAndrew Engelbrecht <andrew@fsf.org>
Fri, 7 Jan 2022 17:20:14 +0000 (12:20 -0500)
committerroot <root@login1p.fsf.org>
Fri, 7 Jan 2022 17:20:14 +0000 (12:20 -0500)
stream_get_contents() might return false, and we should not implicitly
convert that to a string

lib/Auth/Source/FSFDrupalAuth.php

index 617788e3c1a9c2c1616fc4675c107ca0a7e69019..dc3373e463a5b5cc116779c2f11723427fa63199 100644 (file)
@@ -179,7 +179,7 @@ class FSFDrupalAuth extends \SimpleSAML\Module\core\Auth\UserPassBase
                 $errors_found_yet = true;
             }
     
-            return (!$errors_found_yet && rtrim($result) == "true");
+            return (!$errors_found_yet && is_string($result) && rtrim($result) == "true");
 
         } else {