diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-07-02 04:43:23 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-07-02 04:43:23 +0000 |
commit | 10b5b251f8dddd5c980d0af638a539355f58e5db (patch) | |
tree | 31c215d1f61a312c110bfbd32cf97d737e8cd640 /lib/class | |
parent | 6bf913f3d0c55e6bc4b3746a91c0967c4dbe7ad4 (diff) | |
download | ampache-10b5b251f8dddd5c980d0af638a539355f58e5db.tar.gz ampache-10b5b251f8dddd5c980d0af638a539355f58e5db.tar.bz2 ampache-10b5b251f8dddd5c980d0af638a539355f58e5db.zip |
Process config arrays in a loop, instead of by hand.
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/preference.class.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/class/preference.class.php b/lib/class/preference.class.php index 051e58d8..bc2e9b2e 100644 --- a/lib/class/preference.class.php +++ b/lib/class/preference.class.php @@ -323,15 +323,14 @@ class Preference { * become an array and boolean everythings */ public static function fix_preferences($results) { + $arrays = array('auth_methods', 'tag_order', 'art_order', + 'amazon_base_urls'); - $results['auth_methods'] = trim($results['auth_methods']) ? explode(",",$results['auth_methods']) : array(); - $results['tag_order'] = trim($results['tag_order']) ? explode(",",$results['tag_order']) : array(); - $results['art_order'] = trim($results['art_order']) ? explode(",",$results['art_order']) : array(); - - if (isset($results['amazin_base_urls'])) - $results['amazon_base_urls'] = trim($results['amazin_base_urls']) ? explode(",",$results['amazon_base_urls']) : array(); - else - $results['amazon_base_urls']= array(); + foreach ($arrays as $item) { + $results[$item] = trim($results[$item]) + ? explode(',', $results[$item]) + : array(); + } foreach ($results as $key=>$data) { if (!is_array($data)) { |