Duplicate check
This commit is contained in:
parent
7be59dbeab
commit
1ec6359faa
1 changed files with 4 additions and 3 deletions
|
@ -1897,9 +1897,10 @@ function file_tag_save_file($uid, $item, $file)
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBM::is_result($r)) {
|
||||||
$fields = ['file' => $r[0]['file'] . '[' . file_tag_encode($file) . ']'];
|
if (!stristr($r[0]['file'],'[' . file_tag_encode($file) . ']')) {
|
||||||
Item::update($fields, ['id' => $item]);
|
$fields = ['file' => $r[0]['file'] . '[' . file_tag_encode($file) . ']'];
|
||||||
|
Item::update($fields, ['id' => $item]);
|
||||||
|
}
|
||||||
$saved = PConfig::get($uid, 'system', 'filetags');
|
$saved = PConfig::get($uid, 'system', 'filetags');
|
||||||
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
|
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
|
||||||
PConfig::set($uid, 'system', 'filetags', $saved . '[' . file_tag_encode($file) . ']');
|
PConfig::set($uid, 'system', 'filetags', $saved . '[' . file_tag_encode($file) . ']');
|
||||||
|
|
Loading…
Reference in a new issue