diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-05-19 13:07:47 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-05-19 13:07:47 -0400 |
commit | ef003f48f4a3fe8fb67fda62c70a299b07d75976 (patch) | |
tree | cb5972026e6beed91b5eca2fa4962790244062bd /doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn | |
parent | 53b1c6f559c1d09fbdbc28c8e4d5090dd455cd26 (diff) | |
parent | 4c5987d150b26f638494638f7861fb7646542a37 (diff) |
Merge branch 'master' into po
Conflicts:
debian/changelog
Diffstat (limited to 'doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn')
-rw-r--r-- | doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn b/doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn new file mode 100644 index 000000000..dee1e9891 --- /dev/null +++ b/doc/bugs/pagespec_can__39__t_match___123__curly__125___braces.mdwn @@ -0,0 +1,44 @@ +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 :( : + +[[!inline show="3" feeds="no" archive="yes" pages="*_{*}_*"]] + +(note: the inline above has been restricted to 3 matches to keep this page +concise. Hopefully it is still clear that this page is not in the output set, +and the 3 pages in the output set do not contain curly braces in their +titles). + +When escaped, it doesn't work at all: + +[[!inline show="3" feeds="no" archive="yes" pages="*_\{*}_*"]] + +[[!inline show="3" feeds="no" archive="yes" pages="*_{*\}_*"]] + +More tests: + +"\*{\*": + +[[!inline show="3" feeds="no" archive="yes" pages="*{*"]] + +"\*\\{\*": + +[[!inline show="3" feeds="no" archive="yes" pages="*\{*"]] + +> This is due to the current handling of quoting and escaping issues +> when converting a pagespec to perl code. `safequote` is used to +> safely quote an input string as a `q{}` quote, and it strips +> curlies when doing so to avoid one being used to break out of the `q{}`. +> +> Alternative ways to handle it would be: +> +> * Escape curlies. But then you have to deal with backslashes +> in the user's input as they could try to defeat your escaping. +> Gets tricky. +> +> * Avoid exposing user input to interpolation as a string. One +> way that comes to mind is to have a local string lookup hash, +> and insert each user specified string into it, then use the hash +> to lookup the specified strings at runtime. [[done]] +> +> --[[Joey]] + +Thank you! I'll try it. --Ivan Z. |