]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn
Fix python proxy to not crash when fed unicode data in getstate and setstate.
[ikiwiki.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 :( :
2
3 [[!inline show="3" feeds="no" archive="yes" pages="*_{*}_*"]]
4
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).
9
10 When escaped, it doesn't work at all:
11
12 [[!inline show="3" feeds="no" archive="yes" pages="*_\{*}_*"]]
13
14 [[!inline show="3" feeds="no" archive="yes" pages="*_{*\}_*"]]
15
16 More tests:
17
18 "\*{\*":
19
20 [[!inline show="3" feeds="no" archive="yes" pages="*{*"]]
21
22 "\*\\{\*":
23
24 [[!inline show="3" feeds="no" archive="yes" pages="*\{*"]]
25
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]] 
43
44 Thank you! I'll try it. --Ivan Z.