diff options
Diffstat (limited to 'lib/class/preference.class.php')
-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)) { |