From: Reini U. <ru...@x-...> - 2004-05-15 23:26:53
|
This patch fixes a totally weird bug intoduced with 1.3.10, with numeric pagenames and DEBUG = true or > 0: If you get an assertion error in WikiDB.php around line 172, either turn off DEBUG or apply this patch: RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB.php,v retrieving revision 1.55 retrieving revision 1.56 diff -u -2 -b -p -d -r1.55 -r1.56 --- WikiDB.php 12 May 2004 19:27:47 -0000 1.55 +++ WikiDB.php 15 May 2004 22:54:49 -0000 1.56 @@ -166,6 +166,7 @@ class WikiDB { function getPage($pagename) { static $error_displayed = false; + $pagename = (string) $pagename; if (DEBUG) { - if (!(is_string($pagename) and $pagename != '')) { + if ($pagename === '') { if ($error_displayed) return false; $error_displayed = true; @@ -175,6 +176,7 @@ class WikiDB { return false; } - } else - assert(is_string($pagename) and $pagename != ''); + } else { + assert($pagename != ''); + } return new WikiDB_Page($this, $pagename); } -- Reini Urban http://phpwiki.sf.net/ |