Bug #67260 [Opn->Fbk]: php v5.5.12-1~dotdeb.1 parse_ini_file problems
Edit report at https://bugs.php.net/bug.php?id=67260&edit=1
ID: 67260
Updated by: cmb@php.net
Reported by: hakery at bk dot ru
Summary: php v5.5.12-1~dotdeb.1 parse_ini_file problems
-Status: Open
+Status: Feedback
Type: Bug
Package: PHP options/info functions
Operating System: Debian 7 (x64)
PHP Version: 5.5.12
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Is this still an issue with any of the actively supported PHP
versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2014-05-12 16:32:42] hakery at bk dot ru
Description:
------------
problem occurs when parsing ini file.
Apache Web server successfully handles parsing and outputs the result, in my case it change language
on the site. Language changes successfully but at the same time, the script displays an error that I
could not find the file.on the server and Ñentos 5.5.11 was no such problem
Test script:
---------------
function lang(){
if(!isset($_SESSION['country'])){ //ÐÑовеÑки
ÑеÑÑии. ÐÑли ÑеÑÑÐ¸Ñ Ð¿ÑÑÑаÑ
полÑÑаем код ÑÑÑÐ°Ð½Ñ Ð¿Ð¾ ÐÐ
полÑзоваÑелÑ
$country = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$_SESSION['country']=$country;
$langMod =$country.".ini";
$landDir= $_SERVER['DOCUMENT_ROOT'].'/lang/'.$langMod;
$_SESSION['DebugTemp']='ÐебÑло ÑеÑÑии и
опÑеделили его по ип';
if(file_exists($landDir))
{
$lang = parse_ini_file("$landDir"); //пÑовеÑÑем
еÑÑÑ Ð»Ð¸ ÑзÑковой Ð¿Ð°ÐºÐµÑ Ð²
папке, еÑли еÑÑÑ Ñо
загÑÑжаем его
}else{ // еÑли пакеÑа неÑÑ Ð³ÑÑзим
по ÑмолÑÐ°Ð½Ð¸Ñ Ð°Ð½Ð³Ð»
$langMod ="us.ini";
$landDir= $_SERVER['DOCUMENT_ROOT'].'/lang/'.$langMod;
$lang = parse_ini_file("$landDir");
}
}else{
$langSession =$_SESSION['country'];
$langMod = $langSession;
$landDir= $_SERVER['DOCUMENT_ROOT'].'/lang/'.$langMod.'.ini';
$lang = parse_ini_file("$landDir");
$_SESSION['DebugTemp']='из ÑеÑÑии';
}
}
Expected result:
----------------
change language
Actual result:
--------------
hange of language but also informs that the current language pack does not have a
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67260&edit=1
Thread (3 messages)