Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv15451
Modified Files:
Tag: release-1_2-branch
msql.php
Log Message:
Fixed bug where page titles with apostrophes caused a sql error.
Index: msql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/Attic/msql.php,v
retrieving revision 1.6.2.5
retrieving revision 1.6.2.6
diff -C2 -r1.6.2.5 -r1.6.2.6
*** msql.php 2001/11/16 01:22:27 1.6.2.5
--- msql.php 2001/11/16 02:42:27 1.6.2.6
***************
*** 231,238 ****
for ($x = 0; $x < count($pagehash["content"]); $x++) {
$line = addslashes($pagehash["content"][$x]);
$query = "INSERT INTO $dbi[page_table] " .
"(pagename, lineno, line) " .
! "VALUES('$pagename', $x, '$line')";
! // echo "Page line insert query: $query<br>\n";
$retval = msql_query($query, $dbi['dbc']);
if ($retval == false) {
--- 231,239 ----
for ($x = 0; $x < count($pagehash["content"]); $x++) {
$line = addslashes($pagehash["content"][$x]);
+ $esc_pagename = addslashes($pagename);
$query = "INSERT INTO $dbi[page_table] " .
"(pagename, lineno, line) " .
! "VALUES('$esc_pagename', $x, '$line')";
! echo "Page line insert query: $query<br>\n";
$retval = msql_query($query, $dbi['dbc']);
if ($retval == false) {
|