cms icon indicating copy to clipboard operation
cms copied to clipboard

Collection tag condition with umlauts in get value don't work

Open j3ll3yfi5h opened this issue 4 years ago • 2 comments
trafficstars

Bug description

Found out, that umlauts in a get value, used in the collection tag condition, don't work.

How to reproduce

Pages -> Entry: Title: Über uns (About)

/?q=Über

Neither of them works:

{{ collection:pages title:contains="{get:q}" }}
    {{ title }}
{{ /collection:pages }}
{{ collection:pages title:contains="{get}{q}{/get}" }}
    {{ title }}
{{ /collection:pages }}
{{ collection:pages title:contains="{get:q|urldecode}" }}
    {{ title }}
{{ /collection:pages }}
{{ collection:pages title:contains="{get}{q|urldecode}{/get}" }}
    {{ title }}
{{ /collection:pages }}

This works correctly:

{{ collection:pages title:contains="Über" }}
    {{ title }}
{{ /collection:pages }}

Logs

No response

Versions

Statamic 3.2.22 Pro Laravel 8.73.0 PHP 8.0.12 No addons installed

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

j3ll3yfi5h avatar Nov 19 '21 14:11 j3ll3yfi5h

Maybe related to #4405

j3ll3yfi5h avatar Feb 11 '22 09:02 j3ll3yfi5h

In case anyone else is running into this...

The get variables are sanitised and as part of this sanitisation, characters like ü becomes ü. You can see more information about why this is happening in this comment.

In the meantime, I think something like this should work:

{{ collection:pages title:contains="{get:q | decode}" }}

duncanmcclean avatar Jan 08 '24 12:01 duncanmcclean

This has been fixed in Statamic 5, which we're hoping to release in the next few days/weeks.

duncanmcclean avatar Apr 05 '24 14:04 duncanmcclean