From: Rasmus Lerdorf Date: Sun, 28 Nov 1999 16:23:30 +0000 (+0000) Subject: (symlink) Disable symlinks to urls X-Git-Tag: PRE_RETURN_REF_PATCH~191 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6132f85c8d48dcd7485777e64d1eb0fd39387712;p=php (symlink) Disable symlinks to urls @- Disable symlinks to urls --- diff --git a/ext/standard/link.c b/ext/standard/link.c index b6071d4c09..077d63c524 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -116,6 +116,10 @@ PHP_FUNCTION(symlink) 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 symlink to a URL"); + RETURN_FALSE; + } ret = symlink((*topath)->value.str.val, (*frompath)->value.str.val); if (ret == -1) {