aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-09-09 13:33:36 +0200
committerGravatar GitHub <noreply@github.com> 2024-09-09 13:33:36 +0200
commit86f2cd24c5450f4316eea8366f505d7c7db532e6 (patch)
tree964dbf23290f20ac1c6aef01a2d9db72f44d74d4 /app
parentfeffa5598c4c18433d3a8a61e52d94f57ce2f066 (diff)
Better import Inoreader (#6791)
fix https://github.com/FreshRSS/FreshRSS/discussions/6762
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/importExportController.php15
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]);
}