diff options
-rw-r--r-- | ext/standard/link.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/link.c b/ext/standard/link.c index 077d63c524..9ccf0ecdda 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -149,6 +149,10 @@ PHP_FUNCTION(link) if (PG(safe_mode) && !_php3_checkuid((*topath)->value.str.val, 2)) { RETURN_FALSE; } + if (!strncasecmp((*topath)->value.str.val,"http://",7) || !strncasecmp((*topath)->value.str.val,"ftp://",6)) { + php_error(E_WARNING, "Unable to link to a URL"); + RETURN_FALSE; + } ret = link((*topath)->value.str.val, (*frompath)->value.str.val); if (ret == -1) { |