1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-03-10 20:31:47 +00:00

Escape backslashes. Issue #800.

This commit is contained in:
sledgehammer999 2014-11-16 20:41:24 +02:00
parent bba8e18812
commit 0adb9fcbce

View File

@ -70,14 +70,14 @@ bool RssDownloadRule::matches(const QString &article_title) const
QString s = f.cap(1); QString s = f.cap(1);
QStringList eps = f.cap(2).split(";"); QStringList eps = f.cap(2).split(";");
QString expStr; QString expStr;
expStr += "s0?" + s + "[ -_\.]?" + "e0?"; expStr += "s0?" + s + "[ -_\\.]?" + "e0?";
foreach (const QString& ep, eps) { foreach (const QString& ep, eps) {
if (ep.isEmpty()) if (ep.isEmpty())
continue; continue;
if (ep.indexOf('-') != -1) { // Range detected if (ep.indexOf('-') != -1) { // Range detected
QString partialPattern = "s0?" + s + "[ -_\.]?" + "e(0?\\d{1,4})"; QString partialPattern = "s0?" + s + "[ -_\\.]?" + "e(0?\\d{1,4})";
QRegExp reg(partialPattern, Qt::CaseInsensitive); QRegExp reg(partialPattern, Qt::CaseInsensitive);
if (ep.endsWith('-')) { // Infinite range if (ep.endsWith('-')) { // Infinite range