Преглед на файлове

! Stupid rookie mistake of mine.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer преди 11 години
родител
ревизия
4a10ad7b09
променени са 5 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 1 1
      Sources/Subs-Db-mysql.php
  2. 1 1
      Sources/Subs-Db-mysqli.php
  3. 1 1
      Sources/Subs-Db-postgresql.php
  4. 1 1
      Sources/Subs-Db-sqlite.php
  5. 1 1
      Sources/Subs-Db-sqlite3.php

+ 1 - 1
Sources/Subs-Db-mysql.php

@@ -146,7 +146,7 @@ function smf_db_replacement__callback($matches)
 		smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);
 
 	if ($matches[1] === 'literal')
-		return mysql_real_escape_string($matches[2], $connection);
+		return '\'' . mysql_real_escape_string($matches[2], $connection) . '\'';
 
 	if (!isset($values[$matches[2]]))
 		smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . (isset($smcFunc['htmlspecialchars']) ? $smcFunc['htmlspecialchars']($matches[2]) : htmlspecialchars($matches[2])), '', E_USER_ERROR, __FILE__, __LINE__);

+ 1 - 1
Sources/Subs-Db-mysqli.php

@@ -168,7 +168,7 @@ function smf_db_replacement__callback($matches)
 		smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);
 
 	if ($matches[1] === 'literal')
-		return mysqli_real_escape_string($connection, $matches[2]);
+		return '\'' . mysqli_real_escape_string($connection, $matches[2]) . '\'';
 
 	if (!isset($values[$matches[2]]))
 		smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . (isset($smcFunc['htmlspecialchars']) ? $smcFunc['htmlspecialchars']($matches[2]) : htmlspecialchars($matches[2])), '', E_USER_ERROR, __FILE__, __LINE__);

+ 1 - 1
Sources/Subs-Db-postgresql.php

@@ -140,7 +140,7 @@ function smf_db_replacement__callback($matches)
 		smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);
 
 	if ($matches[1] === 'literal')
-		return pg_escape_string($matches[2]);
+		return '\'' . pg_escape_string($matches[2]) . '\'';
 
 	if (!isset($values[$matches[2]]))
 		smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . (isset($smcFunc['htmlspecialchars']) ? $smcFunc['htmlspecialchars']($matches[2]) : htmlspecialchars($matches[2])), '', E_USER_ERROR, __FILE__, __LINE__);

+ 1 - 1
Sources/Subs-Db-sqlite.php

@@ -152,7 +152,7 @@ function smf_db_replacement__callback($matches)
 		smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);
 
 	if ($matches[1] === 'literal')
-		return sqlite_escape_string($matches[2]);
+		return '\'' . sqlite_escape_string($matches[2]) . '\'';
 
 	if (!isset($values[$matches[2]]))
 		smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . (isset($smcFunc['htmlspecialchars']) ? $smcFunc['htmlspecialchars']($matches[2]) : htmlspecialchars($matches[2])), '', E_USER_ERROR, __FILE__, __LINE__);

+ 1 - 1
Sources/Subs-Db-sqlite3.php

@@ -183,7 +183,7 @@ function smf_db_replacement__callback($matches)
 		smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);
 
 	if ($matches[1] === 'literal')
-		return SQLite::escapeString($matches[2]);
+		return '\'' . SQLite::escapeString($matches[2]) . '\'';
 
 	if (!isset($values[$matches[2]]))
 		smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . (isset($smcFunc['htmlspecialchars']) ? $smcFunc['htmlspecialchars']($matches[2]) : htmlspecialchars($matches[2])), '', E_USER_ERROR, __FILE__, __LINE__);