Tags:
create new tag
view all tags

Bug: Unfriendly Error Message when Using Invalid Regular Expression Search

You get an unhelpful error message if you specify an invalid regular expression search. The search should fail gracefully with an understandable error message.

Test case

%SEARCH{ "*WebS*" scope="topic" regex="on" nosearch="on" nosummary="on" nototal="on" format=" * $topic"}%

Temporarily remove the 'nop' above to enable the SEARCH.

  • The invalid regex is "*WebS*"
  • The correct regex is "^.*WebS.*$"

The invalid regex produces different error messages depending on the system used:

  • TWiki.org with Debian Linux:
    • User gets: Software error: Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE WebS*/ at /path/to/twiki/lib/TWiki/Search.pm line 188 instead of the rendered page content

  • Other system with RedHat Enterprise Linux, Perl v5.8 with SpeedyCGI:
    • User gets "500 Internal Server Error" instead of the rendered page content
    • Apache error log has: Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE WebS*/ at /path/to/twiki/lib/TWiki/Search.pm line 188

In both cases, the user should see the rendered page content with an error message at the place of the SEARCH.

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: N/A
Web server: N/A
Perl version: N/A
Client OS: N/A
Web Browser: N/A

-- PeterThoeny - 30 Mar 2005

Impact and Available Solutions

Follow up

Fix record

Discussion

Topic revision: r1 - 2005-03-30 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.