4
0
Эх сурвалжийг харах

Fix auto-read tags (#6790)

fix https://github.com/FreshRSS/FreshRSS/issues/6788
Alexandre Alapetite 1 жил өмнө
parent
commit
af0498fe67

+ 4 - 0
app/Models/Entry.php

@@ -670,6 +670,7 @@ HTML;
 					foreach ($filter->getTags() as $tag2) {
 					foreach ($filter->getTags() as $tag2) {
 						$found = false;
 						$found = false;
 						foreach ($this->tags as $tag1) {
 						foreach ($this->tags as $tag1) {
+							$tag1 = ltrim($tag1, '#');
 							if (strcasecmp($tag1, $tag2) === 0) {
 							if (strcasecmp($tag1, $tag2) === 0) {
 								$found = true;
 								$found = true;
 								break;
 								break;
@@ -682,6 +683,7 @@ HTML;
 					foreach ($filter->getTagsRegex() as $tag2) {
 					foreach ($filter->getTagsRegex() as $tag2) {
 						$found = false;
 						$found = false;
 						foreach ($this->tags as $tag1) {
 						foreach ($this->tags as $tag1) {
+							$tag1 = ltrim($tag1, '#');
 							if (preg_match($tag2, $tag1) === 1) {
 							if (preg_match($tag2, $tag1) === 1) {
 								$found = true;
 								$found = true;
 								break;
 								break;
@@ -694,6 +696,7 @@ HTML;
 					foreach ($filter->getNotTags() as $tag2) {
 					foreach ($filter->getNotTags() as $tag2) {
 						$found = false;
 						$found = false;
 						foreach ($this->tags as $tag1) {
 						foreach ($this->tags as $tag1) {
+							$tag1 = ltrim($tag1, '#');
 							if (strcasecmp($tag1, $tag2) === 0) {
 							if (strcasecmp($tag1, $tag2) === 0) {
 								$found = true;
 								$found = true;
 								break;
 								break;
@@ -706,6 +709,7 @@ HTML;
 					foreach ($filter->getNotTagsRegex() as $tag2) {
 					foreach ($filter->getNotTagsRegex() as $tag2) {
 						$found = false;
 						$found = false;
 						foreach ($this->tags as $tag1) {
 						foreach ($this->tags as $tag1) {
+							$tag1 = ltrim($tag1, '#');
 							if (preg_match($tag2, $tag1) === 1) {
 							if (preg_match($tag2, $tag1) === 1) {
 								$found = true;
 								$found = true;
 								break;
 								break;