Inital commit
This commit is contained in:
@@ -66,8 +66,10 @@ class I18n
|
||||
Lang::getDefaultLanguage()->getLocale()
|
||||
)->findOne();
|
||||
}
|
||||
if (null === $i18n) { // @todo something else ?
|
||||
$i18n = new $i18nClass();;
|
||||
if (null === $i18n) {
|
||||
// @todo something else ?
|
||||
$i18n = new $i18nClass();
|
||||
;
|
||||
$i18n->setId($id);
|
||||
foreach ($needed as $need) {
|
||||
$method = sprintf('set%s', $need);
|
||||
@@ -94,8 +96,8 @@ class I18n
|
||||
static::$defaultLocale = Lang::getDefaultLanguage()->getLocale();
|
||||
}
|
||||
|
||||
$locale = static::real_escape($locale);
|
||||
$defaultLocale = static::real_escape(static::$defaultLocale);
|
||||
$locale = static::realEscape($locale);
|
||||
$defaultLocale = static::realEscape(static::$defaultLocale);
|
||||
|
||||
$query
|
||||
->_and()
|
||||
@@ -104,7 +106,6 @@ class I18n
|
||||
"(SELECT DISTINCT ".$i18nIdColumn." ".
|
||||
"FROM `".$i18nTableName."` ".
|
||||
"WHERE locale=$locale) ".
|
||||
|
||||
"THEN ".$localeColumn." = $locale ".
|
||||
"ELSE ".$localeColumn." = $defaultLocale ".
|
||||
"END"
|
||||
@@ -118,7 +119,7 @@ class I18n
|
||||
*
|
||||
* Really escapes a string for SQL query.
|
||||
*/
|
||||
public static function real_escape($str)
|
||||
public static function realEscape($str)
|
||||
{
|
||||
$str = trim($str, "\"'");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user