Support » Plugin: Banhammer » Use filter_var instead of preg_match (much better performance)

  • Resolved danielrufde

    (@danielrufde)


    I do not know the reason why the big regular expression is used (and where it is from) to check if a string is an IPv6 address. Also I am not sure why the regular expression tries to match a string with optional whitespace characters at the beginning and end of it.

    But I think filter_var with the correct flags is a much better and faster solution.

    See the time values at https://3v4l.org/FS5fJ

    • This topic was modified 1 year, 8 months ago by danielrufde.
    • This topic was modified 1 year, 8 months ago by danielrufde.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use filter_var instead of preg_match (much better performance)’ is closed to new replies.