aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-03-16 19:45:39 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-03-16 19:45:39 +0100
commite685b541487b814cbab87ea2b6a6a4d12cd72f06 (patch)
tree184cf3d29662b0fa1cc6ea8e0250c972abc25715 /app/Models
parentdbdda1d0c19b48d06b30879e8fe78679f79cc0c4 (diff)
parent996c387f50f9b65f271b3cd13b9d63165236b6d2 (diff)
Merge branch 'dev' into 163-export
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Configuration.php15
-rw-r--r--app/Models/Feed.php11
-rw-r--r--app/Models/Share.php3
-rw-r--r--app/Models/Themes.php1
4 files changed, 18 insertions, 12 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;
}
}
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 73f9c32fb..bce3bd24f 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -254,11 +254,12 @@ class FreshRSS_Feed extends Minz_Model {
$elinks = array();
foreach ($item->get_enclosures() as $enclosure) {
$elink = $enclosure->get_link();
- if (array_key_exists($elink, $elinks)) continue;
- $elinks[$elink] = '1';
- $mime = strtolower($enclosure->get_type());
- if (strpos($mime, 'image/') === 0) {
- $content .= '<br /><img src="' . $elink . '" alt="" />';
+ if (empty($elinks[$elink])) {
+ $elinks[$elink] = '1';
+ $mime = strtolower($enclosure->get_type());
+ if (strpos($mime, 'image/') === 0) {
+ $content .= '<br /><img src="' . $elink . '" alt="" />';
+ }
}
}
diff --git a/app/Models/Share.php b/app/Models/Share.php
index 887fcef05..b146db722 100644
--- a/app/Models/Share.php
+++ b/app/Models/Share.php
@@ -3,9 +3,6 @@
class FreshRSS_Share {
static public function generateUrl($options, $selected, $link, $title) {
- if (!array_key_exists('url', $selected)) {
- $selected['url'] = '';
- }
$share = $options[$selected['type']];
$matches = array(
'~URL~',
diff --git a/app/Models/Themes.php b/app/Models/Themes.php
index c7099a1df..ed746b7e9 100644
--- a/app/Models/Themes.php
+++ b/app/Models/Themes.php
@@ -77,6 +77,7 @@ class FreshRSS_Themes extends Minz_Model {
'down' => '▽',
'favorite' => '★',
'help' => 'ⓘ',
+ 'key' => '⚿',
'link' => '↗',
'login' => '🔒',
'logout' => '🔓',