diff options
author | Christian Schneider | 2017-05-02 15:57:19 +0200 |
---|---|---|
committer | Christian Schneider | 2017-05-02 15:57:19 +0200 |
commit | f2c2eb24bfb7b9205d9c67449210d83308c1de78 (patch) | |
tree | 484e0fcb47cddf17871b56c73122b785fa621438 | |
parent | d5fd2c8b0270559ebe0d98e0b756aa9bd9913739 (diff) | |
download | itools-f2c2eb24bfb7b9205d9c67449210d83308c1de78.tar.gz itools-f2c2eb24bfb7b9205d9c67449210d83308c1de78.tar.bz2 itools-f2c2eb24bfb7b9205d9c67449210d83308c1de78.zip |
Remove shebang line when converting syntax in it_auto_prepend.php
-rw-r--r-- | it_auto_prepend.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/it_auto_prepend.php b/it_auto_prepend.php index cea5a0d..8589f9f 100644 --- a/it_auto_prepend.php +++ b/it_auto_prepend.php @@ -142,7 +142,9 @@ function it_convert($source) { if ($changed = filesize($source) < 200000) # Do not attempt to convert anything above 200k to avoid large memory consumption { - $converter = new it_syntaxconverter(file_get_contents($source)); + if (substr($code = file_get_contents($source), 0, 3) == '#!/') + $code = preg_replace('/^[^\r\n]*[\r\n]+/', '', $code); # Remove shebang line when converting syntax + $converter = new it_syntaxconverter($code); $parts = explode("/", dirname($converted)); for ($i = 1; $i <= count($parts); $i++) |