If somehow, this article is the first place you’ve realized you should stop using short open tags, it’s never too late! Below is a find / sed line to convert your php files from short open tags to “normal” ones. This line works pretty good but it’s always a good idea to backup your scripts before doing such massive automated injection.
find . -iname '*.php' -type f -print0 |xargs -0 sed -i -e 's/<? /
Don’t forget that this line will look for *.php files under the current folder due to the dot (.) which is the first argument of the find command.
It will apply these replaces:
From | To |
<? | <?php |
<?// | <?php // |
<?/* | <?php /* |
<?= | <?php echo |