From 6b00b29e7569230eb20c06cee834883046c82ce8 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 24 May 2011 17:49:31 -0400 Subject: [PATCH] CC-2313: update INI value function needs fixing in upgrade scripts -upgrade scripts were still broken... --- Changelog | 1 + install/upgrades/airtime-1.8.1/airtime-upgrade.php | 12 ++++++++---- install/upgrades/airtime-1.8.2/airtime-upgrade.php | 12 ++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Changelog b/Changelog index 128c4bd86..b979e0399 100644 --- a/Changelog +++ b/Changelog @@ -16,6 +16,7 @@ Highlights: - In the "Add Media" page, the "start upload" button vanished after upload. Now it remains there after upload so it is possible to upload again. - When canceling a playing show, the currently playing audio file still showed as playing. This has been fixed. - Audio files greater than 100MB were not being played. + - Fixed uploading audio on Chrome 11 and higher 1.8.1 - May 2, 2011 diff --git a/install/upgrades/airtime-1.8.1/airtime-upgrade.php b/install/upgrades/airtime-1.8.1/airtime-upgrade.php index 594eb71e8..45eacf77b 100644 --- a/install/upgrades/airtime-1.8.1/airtime-upgrade.php +++ b/install/upgrades/airtime-1.8.1/airtime-upgrade.php @@ -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; + } } } diff --git a/install/upgrades/airtime-1.8.2/airtime-upgrade.php b/install/upgrades/airtime-1.8.2/airtime-upgrade.php index 0b3258c34..ca0e4b046 100644 --- a/install/upgrades/airtime-1.8.2/airtime-upgrade.php +++ b/install/upgrades/airtime-1.8.2/airtime-upgrade.php @@ -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; + } } }