[ phpwiki-Bugs-898661 ] InsertPage for dba may generate wrong warnings

"SourceForge.net" <[email protected]> Tue, 17 Feb 2004 03:30:21 -0800
Newsgroups gmane.comp.web.wiki.phpwiki.bugs
Message-ID <[email protected]>
Bugs item #898661, was opened at 2004-02-17 12:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106121&aid=898661&group_id=6121

Category: DBM
Group: PHP error
Status: Open
Resolution: None
Priority: 5
Submitted By: M. Uli Kusterer (witness)
Assigned to: Nobody/Anonymous (nobody)
Summary: InsertPage for dba may generate wrong warnings

Initial Comment:
Hi,

 in dbalib.php, the InsertPage() function is missing two "@" signs 
to suppress warnings. Below is the fixed version:

   // Either insert or replace a key/value (a page)
   function InsertPage($dbi, $pagename, $pagehash) {
      $pagedata = PadSerializedData(serialize($pagehash));

      if (!@dba_insert($pagename, $pagedata, $dbi['wiki'])) {
         if (!@dba_replace($pagename, $pagedata, $dbi['wiki'])) {
            ExitWiki("Error inserting page '$pagename'");
         }
      } 
   }

If the two "@" signs aren't present, I get a warning whenever 
editing a page telling me that it couldn't replace the page. (but 
since, after that warning, it tries replacing the page and that 
succeeds, this warning is completely unnecessary).

 Oh yeah: This is with 1.2.2 (which is the last one marked as 
stable)

Cheers,
-- M. Uli Kusterer

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106121&aid=898661&group_id=6121


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click