CC-2313: update INI value function needs fixing in upgrade scripts

-upgrade scripts were still broken...
This commit is contained in:
Martin Konecny 2011-05-24 17:49:31 -04:00
parent 6fd2985fe0
commit 6b00b29e75
3 changed files with 17 additions and 8 deletions

View file

@ -164,10 +164,14 @@ function UpdateIniValue($p_filename, $p_property, $p_value)
{
$lines = file($p_filename);
$n=count($lines);
for ($i=0; $i<$n; $i++) {
if (strlen($lines[$i]) > strlen($p_property))
if ($p_property == substr($lines[$i], 0, strlen($p_property))){
$lines[$i] = "$p_property = $p_value\n";
foreach ($lines as &$line) {
if ($line[0] != "#"){
$key_value = split("=", $line);
$key = trim($key_value[0]);
if ($key == $p_property){
$line = "$p_property = $p_value".PHP_EOL;
}
}
}

View file

@ -164,10 +164,14 @@ function UpdateIniValue($p_filename, $p_property, $p_value)
{
$lines = file($p_filename);
$n=count($lines);
for ($i=0; $i<$n; $i++) {
if (strlen($lines[$i]) > strlen($p_property))
if ($p_property == substr($lines[$i], 0, strlen($p_property))){
$lines[$i] = "$p_property = $p_value\n";
foreach ($lines as &$line) {
if ($line[0] != "#"){
$key_value = split("=", $line);
$key = trim($key_value[0]);
if ($key == $p_property){
$line = "$p_property = $p_value".PHP_EOL;
}
}
}