From 7e1c8bc7ed04bfcdf2b198629b5ef656015f8916 Mon Sep 17 00:00:00 2001 From: sakamocchi Date: Sat, 21 Apr 2012 11:36:27 +0900 Subject: [PATCH] =?utf8?q?MERGE:=20=E3=83=AA=E3=83=93=E3=82=B8=E3=83=A7?= =?utf8?q?=E3=83=B31774=E3=81=AE=E3=83=9E=E3=83=BC=E3=82=B8=E3=80=82global?= =?utf8?q?functions.php=E3=81=AEselectLanguage()=E3=82=92=E9=9D=9E?= =?utf8?q?=E6=8E=A8=E5=A5=A8=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit この関数によって他の翻訳ファイルをインクルードすることにより、定数の衝突が発生し、大量の警告が出る。そのためこの関数を廃止目的で非推奨とする。 --- nucleus/libs/globalfunctions.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/nucleus/libs/globalfunctions.php b/nucleus/libs/globalfunctions.php index 9c78e2f..fb34ec9 100644 --- a/nucleus/libs/globalfunctions.php +++ b/nucleus/libs/globalfunctions.php @@ -1407,19 +1407,6 @@ function selectItem($id) { $itemid = intval($id); } -// force the use of a translation file (warning: can cause warnings) -function selectLanguage($language) { - - global $DIR_LANG; - - # replaced ereg_replace() below with preg_replace(). ereg* functions are deprecated in PHP 5.3.0 - # original ereg_replace: preg_replace( '@\\|/@', '', $language) . '.php') - # important note that '\' must be matched with '\\\\' in preg* expressions - - include($DIR_LANG . preg_replace('#[\\\\|/]#', '', $language) . '.php'); - -} - function parseFile($filename, $includeMode = 'normal', $includePrefix = '') { $handler = new Actions('fileparser'); $parser = new Parser(SKIN::getAllowedActionsForType('fileparser'), $handler); @@ -2121,6 +2108,13 @@ function getLanguageName() } return $language; } +/* NOTE: this is completely deprecated because generating much warnings */ +function selectLanguage($language) +{ + global $DIR_LANG; + include($DIR_LANG . preg_replace('#[\\\\|/]#', '', $language) . '.php'); + return; +} /* NOTE: use i18n::get_available_locales() directly instead of this */ function checkLanguage($lang) -- 2.11.0