shish / shimmie2

An easy-to-install community image gallery (aka booru)
http://code.shishnet.org/shimmie2/
GNU General Public License v2.0
407 stars 114 forks source link

Searching for tags with ":" or other symbols fails #919

Closed diamondsw closed 1 year ago

diamondsw commented 1 year ago

Server Software

about:
  title: "HomeBooru"
  theme: "danbooru2"

versions:
  shimmie: "2.10.0-alpha"
  schema: 21
  php: "8.2.5"
  db: "pgsql PostgreSQL 11.20 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit"
  os: "Linux 4d65c90ec21a 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64"
  server: "PHP 8.2.5 Development Server"

extensions:
  core: ["admin","alias_editor","bbcode","comment","download","et","ext_manager","four_oh_four","handle_pixel","help_pages","image","index","media","mime","setup","static_files","system","tag_edit","tag_list","upgrade","upload","user","user_config","view"]
  extra: ["favorites","home","pools","random_image","random_list","rating","relationships","tag_categories","tag_tools"]
  handled_mimes: ["image/jpeg","image/gif","image/png","image/webp"]

stats:
  images: 1
  comments: 0
  users: 2

media:
  memory_limit: "8.0MB"
  disk_use: "131.7GB"
  disk_total: "196.7GB"

thumbnails:
  engine: "convert"
  quality: 75
  width: 256
  height: 256
  scaling: 100
  mime: "image/jpeg"

Client Software (please complete the following information)

What steps trigger this bug

  1. Search for any tag with ":" in it, whether an existing category "series:litterbox_comics" or a raw tag "misc:comic". Alternatively, click any of these tags from the tag list on the left column.
  2. Search term has ":" encoded to "%3A", for instance "misc%3Acomic". URL as expected shows the same encoding.

What did you expect to happen? Show results with the categorized tag.

What actually happened?

Error:
No images were found to match the search criteria

Additional Info It should be noted searching for a standard tag (without ":") works as expected. Disabling the tag categorization plugin does not affect this behavior.

I'm happy to repeat this and provide whatever logs are helpful.

diamondsw commented 1 year ago

This appears to affect other queries involving symbols; for instance searching for "tes*" escapes to "tes%2A" and does not match "test" as would be expected.

diamondsw commented 1 year ago

This is caused by the "Nice URLs" setting. Disabling it fixes this, so the bug is somewhere in there. Confirmed on both the alpha listed above and on 2.9.2.

shish commented 1 year ago

Looks like this happens with PHP's built-in webserver, but not nginx or apache...

diamondsw commented 1 year ago

Thanks, this appears fixed; I'm seeing some other odd behavior, but since it's not necessarily related I'll post a new issue.