diff options
author | Stephen Shkardoon <ss23@ss23.geek.nz> | 2011-09-14 21:43:34 +1000 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2011-09-19 13:47:04 -0400 |
commit | eefdaccd394417d82a28e18b863516af25014349 (patch) | |
tree | 8027b0f79cb78e43eb800734a8bf7d892d2a00d8 | |
parent | c3b6ef7ad2e888fd228f62ed3cef6f7d55070a84 (diff) | |
download | ampache-eefdaccd394417d82a28e18b863516af25014349.tar.gz ampache-eefdaccd394417d82a28e18b863516af25014349.tar.bz2 ampache-eefdaccd394417d82a28e18b863516af25014349.zip |
Escape config values when outputting the config file
Allows for odd characters in the database username and password.
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | lib/debug.lib.php | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 7007112b..0ab099cd 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.6-Alpha2 + - Properly escape config values when writing ampache.cfg.php - Fixed session persistence with auth disabled (reported by Nathanael Anderson) - Fixed item count retention for Advanced Random (reported by USAF_Pride) diff --git a/lib/debug.lib.php b/lib/debug.lib.php index bacdd19e..44d427a3 100644 --- a/lib/debug.lib.php +++ b/lib/debug.lib.php @@ -261,7 +261,7 @@ function check_override_memory() { $new_limit = ($current_memory+16) . "M"; /* Bump it by 16 megs (for getid3)*/ - if (!ini_set(memory_limit,$new_limit)) { + if (!ini_set('memory_limit',$new_limit)) { return false; } @@ -357,10 +357,10 @@ function generate_config($current) { /* Put in the current value */ if ($key == 'config_version') { - $line = $key . ' = ' . $value; + $line = $key . ' = ' . addslashes($value); } elseif (isset($current[$key])) { - $line = $key . ' = "' . $current[$key] . '"'; + $line = $key . ' = "' . addslashes($current[$key]) . '"'; unset($current[$key]); } // if set |