Snippets

mason.malone Remove unnecessary PHP_SELFs

Created by mason.malone
1
2
3
4
5
for f in $(git grep -l 'PHP_SELF'); do 
   sed -i -r \
      -e "s/ action=([\"'])[^\"']*(GLOBALS|_SERVER)?\[?.?PHP_SELF.?\]?[^\"']*\1//i" \
      -e " s/href=([\"'])<[^>]*(GLOBALS|_SERVER)\[.?PHP_SELF.?\].*>\?/href=\1?/" "$f";
done

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.