diff options
| author | 2014-03-16 19:45:39 +0100 | |
|---|---|---|
| committer | 2014-03-16 19:45:39 +0100 | |
| commit | e685b541487b814cbab87ea2b6a6a4d12cd72f06 (patch) | |
| tree | 184cf3d29662b0fa1cc6ea8e0250c972abc25715 /app/Models/Configuration.php | |
| parent | dbdda1d0c19b48d06b30879e8fe78679f79cc0c4 (diff) | |
| parent | 996c387f50f9b65f271b3cd13b9d63165236b6d2 (diff) | |
Merge branch 'dev' into 163-export
Diffstat (limited to 'app/Models/Configuration.php')
| -rw-r--r-- | app/Models/Configuration.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 827a1d166..80031369e 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -193,7 +193,9 @@ class FreshRSS_Configuration { if (!is_array($value)) { continue; } - if (array_key_exists('url', $value)) { + + // Verify URL and add default value when needed + if (isset($value['url'])) { $is_url = ( filter_var ($value['url'], FILTER_VALIDATE_URL) || (version_compare(PHP_VERSION, '5.3.3', '<') && @@ -203,10 +205,15 @@ class FreshRSS_Configuration { if (!$is_url) { continue; } - if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { - $value['name'] = $value['type']; - } + } else { + $value['url'] = null; } + + // Add a default name + if (empty($value['name'])) { + $value['name'] = $value['type']; + } + $this->data['sharing'][] = $value; } } |
