diff options
Diffstat (limited to 'app/Controllers/importExportController.php')
| -rw-r--r-- | app/Controllers/importExportController.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index c4f64337b..62f7721ab 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -393,18 +393,15 @@ class FreshRSS_importExport_Controller extends FreshRSS_ActionController { $labels = []; for ($i = count($tags) - 1; $i >= 0; $i--) { $tag = trim($tags[$i]); - if (strpos($tag, 'user/-/') !== false) { - if ($tag === 'user/-/state/com.google/starred') { + if (preg_match('%^user/[A-Za-z0-9_-]+/%', $tag)) { + if (preg_match('%^user/[A-Za-z0-9_-]+/state/com.google/starred$%', $tag)) { $is_starred = true; - } elseif ($tag === 'user/-/state/com.google/read') { + } elseif (preg_match('%^user/[A-Za-z0-9_-]+/state/com.google/read$%', $tag)) { $is_read = true; - } elseif ($tag === 'user/-/state/com.google/unread') { + } elseif (preg_match('%^user/[A-Za-z0-9_-]+/state/com.google/unread$%', $tag)) { $is_read = false; - } elseif (strpos($tag, 'user/-/label/') === 0) { - $tag = trim(substr($tag, 13)); - if ($tag != '') { - $labels[] = $tag; - } + } elseif (preg_match('%^user/[A-Za-z0-9_-]+/label/\s*(?P<tag>.+?)\s*$%', $tag, $matches)) { + $labels[] = $matches['tag']; } unset($tags[$i]); } |
