- // Try to only run PHP once a valid chunk is formed (deals with newlines)
- if ( $__phpPath ) {
- $res = wfShellExecWithStderr(
- "echo " . wfEscapeShellArg( "<?php\n{$__multiLine}{$__line}" ) . " | php -l" );
- if ( strpos( $res, 'No syntax errors' ) !== 0 && substr( $__multiLine, -2 ) !== "\n\n" ) {
- $__multiLine .= "$__line\n";
- continue;
- }
- }