From 7374ff30ef78e125ff433133f11575c5ca85d59a Mon Sep 17 00:00:00 2001 From: nicofrand Date: Sat, 24 Aug 2013 11:10:07 +0200 Subject: Add IPv4 url support (and others beginning by a digit) --- inc/poche/Url.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/poche/Url.class.php') diff --git a/inc/poche/Url.class.php b/inc/poche/Url.class.php index 3c74fb43..b73f3a46 100644 --- a/inc/poche/Url.class.php +++ b/inc/poche/Url.class.php @@ -27,7 +27,7 @@ class Url public function isCorrect() { - $pattern = '|^(.*:)//([a-z\-.]+)(:[0-9]+)?(.*)$|i'; + $pattern = '|^(.*:)//([a-z\-.\d]+)(:[0-9]+)?(.*)$|i'; return preg_match($pattern, $this->url); } @@ -73,7 +73,7 @@ class Url if (preg_replace('/\s+/', '', $body->value) !== "") { $html = $tidy->value; } - } + } $parameters = array(); if (isset($html) and strlen($html) > 0) -- cgit v1.2.3 From 38b95e7be9ce68a86c50486462bee485419a67a8 Mon Sep 17 00:00:00 2001 From: nicofrand Date: Sat, 24 Aug 2013 16:31:22 +0200 Subject: Add IPv4 url support (and others beginning by a digit) --- inc/poche/Url.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'inc/poche/Url.class.php') diff --git a/inc/poche/Url.class.php b/inc/poche/Url.class.php index b73f3a46..302700a9 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\-.\d]+)(:[0-9]+)?(.*)$|i'; - - return preg_match($pattern, $this->url); + return filter_var($this->url, FILTER_VALIDATE_URL); } public function clean() -- cgit v1.2.3 From 149df445d6a13317bf0777e042230ff3386243a8 Mon Sep 17 00:00:00 2001 From: nicofrand Date: Sat, 24 Aug 2013 16:50:28 +0200 Subject: Add IPv4 url support (and others beginning by a digit) --- inc/poche/Url.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche/Url.class.php') diff --git a/inc/poche/Url.class.php b/inc/poche/Url.class.php index 302700a9..d7ee911f 100644 --- a/inc/poche/Url.class.php +++ b/inc/poche/Url.class.php @@ -27,7 +27,7 @@ class Url public function isCorrect() { - return filter_var($this->url, FILTER_VALIDATE_URL); + return filter_var($this->url, FILTER_VALIDATE_URL) !== FALSE; } public function clean() -- cgit v1.2.3