1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 18:15:58 +00:00

get_article_filters: add unicode modifier to preg_match()

This commit is contained in:
Andrew Dolgov
2016-10-19 21:40:58 +03:00
parent 6687cb9927
commit e3dceca66b

View File

@@ -1382,29 +1382,29 @@
switch ($rule["type"]) { switch ($rule["type"]) {
case "title": case "title":
$match = @preg_match("/$reg_exp/i", $title); $match = @preg_match("/$reg_exp/iu", $title);
break; break;
case "content": case "content":
// we don't need to deal with multiline regexps // we don't need to deal with multiline regexps
$content = preg_replace("/[\r\n\t]/", "", $content); $content = preg_replace("/[\r\n\t]/", "", $content);
$match = @preg_match("/$reg_exp/i", $content); $match = @preg_match("/$reg_exp/iu", $content);
break; break;
case "both": case "both":
// we don't need to deal with multiline regexps // we don't need to deal with multiline regexps
$content = preg_replace("/[\r\n\t]/", "", $content); $content = preg_replace("/[\r\n\t]/", "", $content);
$match = (@preg_match("/$reg_exp/i", $title) || @preg_match("/$reg_exp/i", $content)); $match = (@preg_match("/$reg_exp/iu", $title) || @preg_match("/$reg_exp/iu", $content));
break; break;
case "link": case "link":
$match = @preg_match("/$reg_exp/i", $link); $match = @preg_match("/$reg_exp/iu", $link);
break; break;
case "author": case "author":
$match = @preg_match("/$reg_exp/i", $author); $match = @preg_match("/$reg_exp/iu", $author);
break; break;
case "tag": case "tag":
foreach ($tags as $tag) { foreach ($tags as $tag) {
if (@preg_match("/$reg_exp/i", $tag)) { if (@preg_match("/$reg_exp/iu", $tag)) {
$match = true; $match = true;
break; break;
} }