1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 21:52:36 +02:00

(symlink) Disable symlinks to urls

@- Disable symlinks to urls
This commit is contained in:
Rasmus Lerdorf
1999-11-28 16:23:30 +00:00
parent d3c941fc5f
commit 6132f85c8d

View File

@@ -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) {