[php-src] Issue #11138: Misleading note about move_uploaded_file() open_basedir awareness
| From: | MasterTX | Date: | Wed, 26 Apr 2023 20:47:57 +0000 |
| Subject: | [php-src] Issue #11138: Misleading note about move_uploaded_file() open_basedir awareness | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244279@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11138
Author: MasterTX
The manual page: https://php.net/function.move-uploaded-file
contains a note which states:
> move_uploaded_file() is open_basedir aware. However, restrictions are placed only on the **to**
> path
While this is true, if the
from path is not in open_basedir, the file is
moved, but it generates a warning in the error log:
> PHP Warning: move_uploaded_file(): open_basedir restriction in effect. File(/tmp/phpBxHkjL) is
> not within the allowed path(s): (/var/www/uploads/)
Tested on PHP 8.2.5