Improved parsing of tags
This commit is contained in:
parent
a3970ce69a
commit
92d894783e
@ -408,7 +408,7 @@ photo = {
|
||||
|
||||
// Parse tags
|
||||
tags = tags.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g, ',');
|
||||
tags = tags.replace(/,$|^,/g, '');
|
||||
tags = tags.replace(/,$|^,|(\ ){0,}$/g, '');
|
||||
|
||||
if (visible.photo()) {
|
||||
photo.json.tags = tags;
|
||||
|
@ -639,7 +639,7 @@ class Photo extends Module {
|
||||
|
||||
# Parse tags
|
||||
$tags = preg_replace('/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/', ',', $tags);
|
||||
$tags = preg_replace('/,$|^,/', ',', $tags);
|
||||
$tags = preg_replace('/,$|^,|(\ ){0,}$/', '', $tags);
|
||||
if (strlen($tags)>1000) return false;
|
||||
|
||||
# Set tags
|
||||
|
Loading…
Reference in New Issue
Block a user