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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user