From: Nicolas LÅ“uillet Date: Sun, 25 Aug 2013 05:42:37 +0000 (-0700) Subject: Merge pull request #173 from EliasZ/dev X-Git-Tag: 1.0-beta4~13 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=217bacc66371f41a58cca924bec575102491db35;hp=db4767e22b9c130bdfe7102383d0f42a2eece490;p=github%2Fwallabag%2Fwallabag.git Merge pull request #173 from EliasZ/dev Graceful error-handling with imports and defining where import files are stored --- diff --git a/inc/poche/Url.class.php b/inc/poche/Url.class.php index 3c74fb43..d7ee911f 100644 --- a/inc/poche/Url.class.php +++ b/inc/poche/Url.class.php @@ -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) !== "") { $html = $tidy->value; } - } + } $parameters = array(); if (isset($html) and strlen($html) > 0)