]> Pileus Git - vpaste/commitdiff
Cleanup modelines
authorAndy Spencer <andy753421@gmail.com>
Sat, 9 Mar 2013 21:16:46 +0000 (21:16 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sat, 9 Mar 2013 21:16:46 +0000 (21:16 +0000)
This keeps special chars from getting into into the sed commands

index.cgi

index 8a90e181bf53b2d45f80e57f194c16fbc09dc66d..0b7859e77c74ccb4d2021509f6d58211da0ba887 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -15,7 +15,8 @@
 # Remove url codings from stdin
 function get_modeline {
        echo "$QUERY_STRING" |
-       sed -e 's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g; s/[,&?]/ /g' |
+       sed -e 's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' \
+           -e 's/[^a-zA-Z0-9.:=_\-]/ /g' |
        xargs echo -e
 }
 function get_param {