mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-04-21 23:07:25 -04:00
Merge pull request #615 from aledeg/shares
Add a feature to add only unique shares
This commit is contained in:
@@ -212,6 +212,7 @@ class FreshRSS_Configuration {
|
||||
}
|
||||
public function _sharing ($values) {
|
||||
$this->data['sharing'] = array();
|
||||
$unique = array();
|
||||
foreach ($values as $value) {
|
||||
if (!is_array($value)) {
|
||||
continue;
|
||||
@@ -237,7 +238,11 @@ class FreshRSS_Configuration {
|
||||
$value['name'] = $value['type'];
|
||||
}
|
||||
|
||||
$this->data['sharing'][] = $value;
|
||||
$json_value = json_encode($value);
|
||||
if (!in_array($json_value, $unique)) {
|
||||
$unique[] = $json_value;
|
||||
$this->data['sharing'][] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public function _queries ($values) {
|
||||
|
||||
Reference in New Issue
Block a user