From: Rasmus Lerdorf Date: Sun, 28 Nov 1999 16:35:26 +0000 (+0000) Subject: # check link() as well X-Git-Tag: PRE_RETURN_REF_PATCH~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cefad61ede71f567de3132b9788d4b763d7b51b;p=php # check link() as well --- 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) {