Skip to content

Commit

Permalink
Fix double escaping of backslashes
Browse files Browse the repository at this point in the history
In 74b667e, calls to Re.Pcre.regexp
were directly replaced by Re.str, but they do not have the same
semantics: Re.str matches a litteral string, whereas Re.Pcre.regexp
matches a regexp.
  • Loading branch information
glondu authored and kit-ty-kate committed Jul 31, 2024
1 parent cee7341 commit 419c085
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ldap/ldap_filterparser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
%{
open Ldap_types

let star_escape_rex = Re.compile (Re.str ("\\" ^ "\\2a"))
let lparen_escape_rex = Re.compile (Re.str ("\\" ^ "\\28"))
let rparen_escape_rex = Re.compile (Re.str ("\\" ^ "\\29"))
let backslash_escape_rex = Re.compile (Re.str ("\\" ^ "\\5c"))
let null_escape_rex = Re.compile (Re.str ("\\" ^ "\\00"))
let star_escape_rex = Re.compile (Re.str "\\2a")
let lparen_escape_rex = Re.compile (Re.str "\\28")
let rparen_escape_rex = Re.compile (Re.str "\\29")
let backslash_escape_rex = Re.compile (Re.str "\\5c")
let null_escape_rex = Re.compile (Re.str "\\00")
let unescape s =
(Re.replace_string star_escape_rex ~by:"*"
(Re.replace_string lparen_escape_rex ~by:"("
Expand Down

0 comments on commit 419c085

Please sign in to comment.