php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24830 Problem with $fp in Remote.php
Submitted: 2003-07-27 10:02 UTC Modified: 2003-08-02 10:35 UTC
From: nicos@php.net Assigned:
Status: Closed Package: PEAR related
PHP Version: Irrelevant OS: Every
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nicos@php.net
New email:
PHP Version: OS:

 

 [2003-07-27 10:02 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-27 10:05 UTC] nicos@php.net
Btw shouldn't we add some is_readable() stuff? :-)
 [2003-08-02 10:35 UTC] cox@php.net
Thanks nicos, fixed in CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 13:01:34 2025 UTC