From 6132f85c8d48dcd7485777e64d1eb0fd39387712 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 28 Nov 1999 16:23:30 +0000 Subject: [PATCH] (symlink) Disable symlinks to urls @- Disable symlinks to urls --- ext/standard/link.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.40.0