]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn
Add ikistrap plugin for ikistrap theme.
[git.ikiwiki.info.git] / doc / bugs / pagespec_can__39__t_match___123__curly__125___braces.mdwn
1 I want match pages which have actually curly braces in the names (like this one), but this matches a lot of pages without the braces in their names :( :
3 [[!inline show="3" feeds="no" archive="yes" pages="*_{*}_*"]]
5 (note: the inline above has been restricted to 3 matches to keep this page
6 concise. Hopefully it is still clear that this page is not in the output set,
7 and the 3 pages in the output set do not contain curly braces in their
8 titles).
10 When escaped, it doesn't work at all:
12 [[!inline show="3" feeds="no" archive="yes" pages="*_\{*}_*"]]
14 [[!inline show="3" feeds="no" archive="yes" pages="*_{*\}_*"]]
16 More tests:
18 "\*{\*":
20 [[!inline show="3" feeds="no" archive="yes" pages="*{*"]]
22 "\*\\{\*":
24 [[!inline show="3" feeds="no" archive="yes" pages="*\{*"]]
26 > This is due to the current handling of quoting and escaping issues
27 > when converting a pagespec to perl code. `safequote` is used to
28 > safely quote an input string as a `q{}` quote, and it strips
29 > curlies when doing so to avoid one being used to break out of the `q{}`.
30
31 > Alternative ways to handle it would be:
32 >
33 > * Escape curlies. But then you have to deal with backslashes
34 >   in the user's input as they could try to defeat your escaping.
35 >   Gets tricky.
36 >
37 > * Avoid exposing user input to interpolation as a string. One
38 >   way that comes to mind is to have a local string lookup hash,
39 >   and insert each user specified string into it, then use the hash
40 >   to lookup the specified strings at runtime. [[done]]
41
42 > --[[Joey]] 
44 Thank you! I'll try it. --Ivan Z.