From: Steve W. <wai...@us...> - 2001-09-21 21:57:10
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv29174 Modified Files: Tag: release-1_2-branch pgsql.php Log Message: Fixed bug: BackLinkSearchNextMatch needed the address of $res. It was not incrementing $res[row] so it formed an infinite loop and phpwiki would just time out. Index: pgsql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/Attic/pgsql.php,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -r1.4.2.1 -r1.4.2.2 *** pgsql.php 2001/08/18 00:35:10 1.4.2.1 --- pgsql.php 2001/09/21 21:57:07 1.4.2.2 *************** *** 297,303 **** $topage = addslashes($pagename); ! $res['res'] = pg_exec( $dbi["dbc"], ( "SELECT DISTINCT frompage FROM $WikiLinksPageStore" ! . " WHERE topage='$topage'" ! . " ORDER BY frompage" )); $res['row'] = 0; return $res; --- 297,304 ---- $topage = addslashes($pagename); ! $query = "SELECT DISTINCT frompage FROM $WikiLinksPageStore" ! . " WHERE topage='$topage'" ! . " ORDER BY frompage"; ! $res['res'] = pg_exec( $dbi["dbc"], $query); $res['row'] = 0; return $res; *************** *** 305,317 **** ! // iterating through database ! function BackLinkSearchNextMatch($dbi, $res) { ! if($a = @pg_fetch_row($res['res'], $res['row']++)) { ! return $a[0]; ! } ! else { ! return 0; ! } ! } --- 306,319 ---- ! // iterating through database ! function BackLinkSearchNextMatch($dbi, &$res) { ! if($a = @pg_fetch_row($res['res'], $res['row'])) { ! $res['row']++; ! return $a[0]; ! } ! else { ! return 0; ! } ! } |