Follow-up to bugfix #12581: Use FILTER_FLAG_SCHEME_REQUIRED constant in t3lib_div...
authorOliver Hader <oliver.hader@typo3.org>
Wed, 25 Nov 2009 12:09:42 +0000 (12:09 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 25 Nov 2009 12:09:42 +0000 (12:09 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6530 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 88350cd..f88abae 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
 
        * Follow-up to bugfix #12436: Move Suhosin part to php.ini section in the install tool
        * Fixed bug #9981: EM does not test for usage of mod.php-API and spuriously displays an error (thanks to Andreas Kundoch)
+       * Follow-up to bugfix #12581: Use FILTER_FLAG_SCHEME_REQUIRED constant in t3lib_div::isValidUrl()
 
 2009-11-24  Stanislas Rolland  <typo3@sjbr.ca>
 
index b742df7..e8c056d 100644 (file)
@@ -1585,7 +1585,7 @@ final class t3lib_div {
         * @return      boolean         Whether the given URL is valid
         */
        public static function isValidUrl($url) {
-               return (filter_var($url, FILTER_VALIDATE_URL) !== false);
+               return (filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== false);
        }
 
 
@@ -4120,7 +4120,7 @@ final class t3lib_div {
                        );
 
                                // Pass if URL is on the current host:
-                       if (self::isValidUrl($decodedUrl) && preg_match('#^[a-z0-9]+://#', $decodedUrl)) {
+                       if (self::isValidUrl($decodedUrl)) {
                                if (self::isOnCurrentHost($decodedUrl) && strpos($decodedUrl, self::getIndpEnv('TYPO3_SITE_URL')) === 0) {
                                        $sanitizedUrl = $url;
                                }