[PHP-DOC] #35060 [Opn]: problematic safe_mode restriction in GD library
by Moron At Industrial Dot Org other posts by this author
Nov 2 2005 8:53AM messages near this date
[PHP-DOC] #35060 [Opn]: problematic safe_mode restriction in GD library
|
[PHP-DOC] cvs: phpdoc /en/reference/pdo/functions PDO-getAttribute.xml PDO-setAttribute.xml PDOStatement-getAttribute.xml PDOStatement-setAttribute.xml
ID: 35060
User updated by: moron at industrial dot org
Reported By: moron at industrial dot org
Status: Open
Bug Type: Documentation problem
Operating System: FreeBSD (likely all)
PHP Version: 4.4.1RC1
New Comment:
Ok. As an aside though, they have been "wrong" for at least two or
three years now and I have been using the stated functionality in both
PHP 4 and 5 successfully for quite a while so changing this behaviour
will affect any application that uses the GD functions under
"safe_mode".
It's also a bit illogical to have to create the file first, no?
Again, if "touch" and "copy" and "move_uploaded_file" and "unlink" all
can have access to the file in question (as they should in this
scenario), why can't "imagejpeg" do the same "safe_mode" access checks
(as it seems to be attempting to do when looking at the source)? The
file it wants to create is within the open_basedir limits, it is under
a directory with world write permissions and it is owned by the same
group as the script running.
Cheers
Previous Comments:
------------------------------------------------------------------------
[2005-11-02 14:19:01] sniper@[...].net
Docs are wrong.
------------------------------------------------------------------------
[2005-11-01 23:00:10] moron at industrial dot org
http://ca.php.net/manual/en/function.imagejpeg.php
"imagejpeg() creates the JPEG file in filename from the image image.
The image argument is the return from the imagecreatetruecolor()
function."
This definition conflicts with the newly stated requirement that the
file in question already exists. Either the docs are wrong or the
safe_mode check is broken.
------------------------------------------------------------------------
[2005-11-01 22:57:10] moron at industrial dot org
What is bogus about the bug exactly? If "touch()" can create the file
then so should imagejpeg() - is that not the entire point of that
function, to create a file? Nothing in the docus that I could see
state that the file needs to exist previously.
Also, if this is a "feature" can you please explain what that feature
is exactly? It does not seem to adhere to any sane permission scheme I
can think of, at least as far as running PHP as a module under UNIX
style operating systems go.
If this "feature" will not be going away, any chance of getting the
imagejpeg docs updated to note that the new requirement is that the
file in question already exists before it can be written to?
Cheers
------------------------------------------------------------------------
[2005-11-01 22:51:14] sniper@[...].net
and in PHP 5.1 there are even MORE of these checks! =)
(hint: this is not a bug but a feature)
------------------------------------------------------------------------
[2005-11-01 22:39:24] jerome at blion dot dyndns dot org
touch('files/thingy/test.jpg');
before imagejpeg worked for me
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35060
--
Edit this bug report at http://bugs.php.net/?id=35060&edit=1
Thread:
sniper
Moron At Industrial Dot Org
|