]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #173 from EliasZ/dev
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Sun, 25 Aug 2013 05:42:37 +0000 (22:42 -0700)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Sun, 25 Aug 2013 05:42:37 +0000 (22:42 -0700)
Graceful error-handling with imports and defining where import files are stored

inc/poche/Url.class.php

index 3c74fb434bb1b7f14cd0f0934874893c44cb578c..d7ee911fcbbf5c8287ff72a68edd2d98bdb74ec9 100644 (file)
@@ -27,9 +27,7 @@ class Url
 
     public function isCorrect()
     {
-        $pattern = '|^(.*:)//([a-z\-.]+)(:[0-9]+)?(.*)$|i';
-
-        return preg_match($pattern, $this->url);
+        return filter_var($this->url, FILTER_VALIDATE_URL) !== FALSE;
     }
 
     public function clean()
@@ -73,7 +71,7 @@ class Url
                 if (preg_replace('/\s+/', '', $body->value) !== "<body></body>") {
                     $html = $tidy->value;
                 }
-            } 
+            }
 
             $parameters = array();
             if (isset($html) and strlen($html) > 0)