pabsttheater / pabstetix

Issue Tracking for pabsttheater.org
0 stars 0 forks source link

Search doesn't handle certain characters and html as expected #53

Open sarandi opened 5 years ago

sarandi commented 5 years ago

The search function has had two failures recently:

  1. Brian Wilson + The Zombies
    - Brian&nbsp;Wilson +<br /> The&nbsp;Zombies
    - Brian&nbsp;Wilson +&nbsp; The&nbsp;Zombies
    - Brian Wilson + The&nbsp;Zombies
    + Brian Wilson and <br/>The Zombies
    + Brian Wilson and The&nbsp;Zombies
  2. Extreme Midget Wrestling Federation
    - Extreme<br />Midget<br />Wrestling<br />Federation <!-- NB: no space before br -->
    + Extreme <br />Midget <br /> Wrestling <br />Federation

In both cases, it seems to have a difficult time handing the <br /> element without a preceding space. But the main issue is that the + character breaks the search query entirely. Possibly due to SQL escaping issues.

Cases that are working as expected:

  1. using &nbsp; to group words together in the event of line breaks, like so:

    + Brian&nbsp;Wilson and The&nbsp;Zombies
  2. using literal (non-html) special characters like & or é:

    + MSO: An Evening with Hamilton’s Renée Elise Goldsberry
  3. using escaped html special characters like &eacute;:

    + MSO: An Evening with Hamilton’s Ren&eacute;e Elise Goldsberry