Inital commit

This commit is contained in:
2020-11-19 15:36:28 +01:00
parent 71f32f83d3
commit 66ce4ee218
18077 changed files with 2166122 additions and 35184 deletions

View File

@@ -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, "\"'");