1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 23:45:55 +00:00

check regular expression before adding/saving filter

This commit is contained in:
Andrew Dolgov
2010-11-11 14:26:44 +03:00
parent a9d63d29a1
commit f705f20656
4 changed files with 151 additions and 68 deletions

View File

@@ -1128,6 +1128,22 @@
return;
}
if ($subop == "verifyRegexp") {
$reg_exp = $_REQUEST["reg_exp"];
print "<rpc-reply><status>";
if (@preg_match("/$reg_exp/i", "TEST") === false) {
print "INVALID";
} else {
print "OK";
}
print "</status></rpc-reply>";
return;
}
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>