Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Fix for validate url, reported by @myift

givanzbf74fc5111af
diff --git a/system/functions.php b/system/functions.php
index 308f88d..05cb8a8 100755
--- a/system/functions.php
+++ b/system/functions.php
@@ -1772,7 +1772,7 @@ function download($url) {
function validateUrl($url) {
if (strncmp($url, 'http', 4) === 0) {
- if (preg_match('/https?:\/\/(.+?)\//', $url, $matches)) {
+ if (preg_match('/https?:\/\/([^\/$]+)/', $url, $matches)) {
$host = $matches[1];
//don't allow port number
@@ -1786,7 +1786,7 @@ function validateUrl($url) {
}
//don't allow ip
- if (false !== filter_var($url, FILTER_VALIDATE_IP)) {
+ if (false !== filter_var($host, FILTER_VALIDATE_IP)) {
return '';
}