[feladat @ 289]
authorpeter
Wed, 18 Jun 2008 19:11:39 +0000
changeset 181 76a304b484ed
parent 180 e17c8536d718
child 182 049347a649e0
[feladat @ 289] Bugfix: In postgres an empty string ("") was is not automatically casted to 0. Because of this the use of integer is forced in the $db->quote() function. This fixes ticket:40.
inc/record.inc.php
--- a/inc/record.inc.php	Thu Jun 12 22:00:46 2008 +0000
+++ b/inc/record.inc.php	Wed Jun 18 19:11:39 2008 +0000
@@ -127,7 +127,7 @@
 					type=".$db->quote($record['type']).", 
 					content='" . $record['content'] . "', 
 					ttl=".$db->quote($record['ttl']).", 
-					prio=".$db->quote($record['prio']).", 
+					prio=".$db->quote($record['prio'], 'integer').", 
 					change_date=".$db->quote(time())." 
 					WHERE id=".$db->quote($record['rid']);
 				$result = $db->Query($query);
@@ -178,7 +178,7 @@
 						. $db->quote($type) . "," 
 						. $db->quote($content) . ","
 						. $db->quote($ttl) . ","
-						. $db->quote($prio) . ","
+						. $db->quote($prio, 'integer') . ","
 						. $db->quote($change) . ")";
 			$response = $db->query($query);
 			if (PEAR::isError($response)) {
@@ -380,7 +380,7 @@
 									. $db->quote($type) . ","
 									. $db->quote($content) . ","
 									. $db->quote($ttl) . ","
-									. $db->quote($prio) . ","
+									. $db->quote($prio, 'integer') . ","
 									. $db->quote($now) . ")";
 							$response = $db->query($query);
 							if (PEAR::isError($response)) { error($response->getMessage()); return false; }