diff options
author | Rasmus Lerdorf <rasmus@php.net> | 1999-11-28 16:23:30 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 1999-11-28 16:23:30 +0000 |
commit | 6132f85c8d48dcd7485777e64d1eb0fd39387712 (patch) | |
tree | 2c1bc5ac266de443b52304d91c623127dd90929d | |
parent | d3c941fc5f3749b79137e466fcc6ec13368c3baa (diff) | |
download | php-git-6132f85c8d48dcd7485777e64d1eb0fd39387712.tar.gz |
(symlink) Disable symlinks to urls
@- Disable symlinks to urls
-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 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) { |