View | Details | Raw Unified | Return to bug 27431
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-1 / +5 lines)
Lines 983-988 sub _query_regex_escape_process { Link Here
983
            $query =~ s@(?:(?<!\\)(?:((?:[\\]{2})*[\\])|((?:[\\]{2})*))(?=/))(?![^"]*"(?:[^"]*"[^"]*")*[^"]*$)@($1 ? substr($1, 0, -1) : ($2 . "\\"))@ge;
983
            $query =~ s@(?:(?<!\\)(?:((?:[\\]{2})*[\\])|((?:[\\]{2})*))(?=/))(?![^"]*"(?:[^"]*"[^"]*")*[^"]*$)@($1 ? substr($1, 0, -1) : ($2 . "\\"))@ge;
984
        }
984
        }
985
    }
985
    }
986
987
    # Always escape string starting with double hyphen or hyphen alone
988
    $query =~ s@^--@\\--@;
989
    $query =~ s@^-$@\\-@;
990
986
    return $query;
991
    return $query;
987
}
992
}
988
993
989
- 

Return to bug 27431