Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv28827/lib
Modified Files:
Tag: release-1_2-branch
mysql.php
Log Message:
Fix SF bug #462168: hit count broken for pages with apostrophes in their names.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/Attic/mysql.php,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -C2 -r1.10.2.2 -r1.10.2.3
*** mysql.php 2001/08/18 03:57:27 1.10.2.2
--- mysql.php 2001/11/07 18:54:07 1.10.2.3
***************
*** 186,193 ****
global $HitCountStore;
! $res = mysql_query("update $HitCountStore set hits=hits+1 where pagename='$pagename'", $dbi['dbc']);
if (!mysql_affected_rows($dbi['dbc'])) {
! $res = mysql_query("insert into $HitCountStore (pagename, hits) values ('$pagename', 1)", $dbi['dbc']);
}
--- 186,198 ----
global $HitCountStore;
! $qpagename = addslashes($pagename);
! $res = mysql_query("update $HitCountStore set hits=hits+1"
! . " where pagename='$qpagename'",
! $dbi['dbc']);
if (!mysql_affected_rows($dbi['dbc'])) {
! $res = mysql_query("insert into $HitCountStore (pagename, hits)"
! . " values ('$qpagename', 1)",
! $dbi['dbc']);
}
***************
*** 199,203 ****
global $HitCountStore;
! $res = mysql_query("select hits from $HitCountStore where pagename='$pagename'", $dbi['dbc']);
if (mysql_num_rows($res))
$hits = mysql_result($res, 0);
--- 204,211 ----
global $HitCountStore;
! $qpagename = addslashes($pagename);
! $res = mysql_query("select hits from $HitCountStore"
! . " where pagename='$qpagename'",
! $dbi['dbc']);
if (mysql_num_rows($res))
$hits = mysql_result($res, 0);
|