#24830 [Ana->Csd]: Problem with $fp in Remote.php
| From: | cox@php.net | Date: | Sat, 02 Aug 2003 15:35:13 +0000 |
| Subject: | #24830 [Ana->Csd]: Problem with $fp in Remote.php | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19148@lists.php.net to get a copy of this message | ||
ID: 24830
Updated by: cox@php.net
Reported By: nicos@php.net
-Status: Analyzed
+Status: Closed
Bug Type: PEAR related
Operating System: Every
PHP Version: Irrelevant
New Comment:
Thanks nicos, fixed in CVS
Previous Comments:
------------------------------------------------------------------------
[2003-07-27 10:05:14] nicos@php.net
Btw shouldn't we add some is_readable() stuff? :-)
------------------------------------------------------------------------
[2003-07-27 10:02:11] nicos@php.net
Description:
------------
Warning: fwrite(): supplied argument is not a valid stream resource in
Remote.php on line 95
Warning: fclose(): supplied argument is not a valid stream resource in
Remote.php on line 96
In fact the $fp verification is not correct.
But hey, here is the patch !
cvs server: Diffing .
Index: Remote.php
===================================================================
RCS file: /repository/php-src/pear/PEAR/Remote.php,v
retrieving revision 1.41
diff -u -u -r1.41 Remote.php
--- Remote.php 12 Jul 2003 14:25:06 -0000 1.41
+++ Remote.php 27 Jul 2003 14:58:53 -0000
@@ -91,7 +91,7 @@
$filename = $cachedir.'/xmlrpc_cache_'.$id;
$fp = @fopen($filename, "wb");
- if ($fp !== null) {
+ if ($fp !== false) {
fwrite($fp, serialize($data));
fclose($fp);
};
Reproduce code:
---------------
pear info spplus
as non root.
Expected result:
----------------
correct stuff? ;-)
Actual result:
--------------
notices.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24830&edit=1