mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fixes lp:1255359 Translation strings with single quotes break some SQL queries
This commit is contained in:
13
lang.inc.php
13
lang.inc.php
@@ -48,6 +48,19 @@ function translate_array(&$a,$b)
|
||||
if (isset($row[$el])) $row[$el] = T_($row[$el]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate then quote a string to make it ready
|
||||
* for database insertion
|
||||
*
|
||||
* @param string $msg The message to translate and quote
|
||||
* @return string The translated message quoted
|
||||
*/
|
||||
function TQ_($msg)
|
||||
{
|
||||
$msg = T_($msg);
|
||||
$msg = str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$msg);
|
||||
return str_replace("'","\\'",$msg);
|
||||
}
|
||||
|
||||
|
||||
$locale = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||
|
||||
Reference in New Issue
Block a user