From 6087293182f061d8cdf0afcd8ebef5684107c52b Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sat, 14 Jan 2006 15:20:54 +0000 Subject: [PATCH] This is a workaround for an issue involving PHP >= 4.3.4 and MSSQL under certain conditions which caused a space to be returned instead of an empty string. See bug #830 for details If using MSSQL, please test this change and report any errors on that bug report git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5453 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/db/mssql.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/db/mssql.php b/phpBB/db/mssql.php index 136067b804..320561dfaa 100644 --- a/phpBB/db/mssql.php +++ b/phpBB/db/mssql.php @@ -289,7 +289,7 @@ class sql_db while( list($key, $value) = @each($row) ) { - $row[$key] = stripslashes($value); + $row[$key] = ($value === ' ') ? trim($value) : stripslashes($value); } @reset($row); @@ -317,7 +317,7 @@ class sql_db { while( list($key, $value) = @each($row) ) { - $rowset[$i][$key] = stripslashes($value); + $rowset[$i][$key] = ($value === ' ') ? trim($value) : stripslashes($value); } $i++; } @@ -356,7 +356,7 @@ class sql_db if( empty($this->row[$query_id]) ) { $this->row[$query_id] = @mssql_fetch_array($query_id); - $result = stripslashes($this->row[$query_id][$field]); + $result = ($this->row[$query_id][$field] === ' ') ? trim($this->row[$query_id][$field]) : stripslashes($this->row[$query_id][$field]); } }