@ 2015-09-25T19:13:51Z <?php
$code ='<!-- DEFINE $SEARCH_BOX --> <!-- ENDDEFINE -->';
$phpbb_tags = array(
/*'BEGIN',
'BEGINELSE',
'END',
'IF',
'ELSE',
'ELSEIF',
'ENDIF',
'DEFINE',
'UNDEFINE',*/
'ENDDEFINE',
'INCLUDE',
'INCLUDEPHP',
'INCLUDEJS',
'INCLUDECSS',
'PHP',
'ENDPHP',
'EVENT',
);
// Twig tag masks
$twig_tags = array(
'autoescape',
'endautoescape',
'if',
'elseif',
'else',
'endif',
'block',
'endblock',
'use',
'extends',
'embed',
'filter',
'endfilter',
'flush',
'for',
'endfor',
'macro',
'endmacro',
'import',
'from',
'sandbox',
'endsandbox',
'set',
'endset',
'spaceless',
'endspaceless',
'verbatim',
'endverbatim',
);
// Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')
$code = strip_surrounding_quotes(array(
'INCLUDE',
'INCLUDEPHP',
'INCLUDEJS',
'INCLUDECSS',
), $code);
$code = fix_inline_variable_tokens(array(
'DEFINE \$[a-zA-Z0-9_]+ =',
'INCLUDE',
'INCLUDEPHP',
'INCLUDEJS',
'INCLUDECSS',
), $code);
$code = add_surrounding_quotes(array(
'INCLUDE',
'INCLUDEPHP',
'INCLUDEJS',
'INCLUDECSS',
), $code);
// Fix our BEGIN statements
$code = fix_begin_tokens($code);
// Fix our IF tokens
$code = fix_if_tokens($code);
// Fix our DEFINE tokens
$code = fix_define_tokens($code);
// Replace all of our starting tokens, <!-- TOKEN --> with Twig style, {% TOKEN %}
// This also strips outer parenthesis, <!-- IF (blah) --> becomes <!-- IF blah -->
$code = preg_replace('#<!-- (' . implode('|', $phpbb_tags) . ')(?: (.*?) ?)?-->#', '{% $1 $2 %}', $code);
// Replace all of our twig masks with Twig code (e.g. <!-- BLOCK .+ --> with {% block $1 %})
$code = replace_twig_tag_masks($code, $twig_tags);
// Replace all of our language variables, {L_VARNAME}, with Twig style, {{ lang('NAME') }}
// Appends any filters after lang()
$code = preg_replace('#{L_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2 }}', $code);
// Replace all of our escaped language variables, {LA_VARNAME}, with Twig style, {{ lang('NAME')|escape('js') }}
// Appends any filters after lang(), but before escape('js')
$code = preg_replace('#{LA_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2|escape(\'js\') }}', $code);
// Replace all of our variables, {VARNAME}, with Twig style, {{ VARNAME }}
// Appends any filters
$code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code);
echo $code;
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 Fatal error: Uncaught Error: Call to undefined function strip_surrounding_quotes() in /in/r6rVc:56
Stack trace:
#0 {main}
thrown in /in/r6rVc on line 56
Process exited with code 255 . Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Fatal error: Uncaught Error: Call to undefined function strip_surrounding_quotes() in /in/r6rVc:56
Stack trace:
#0 {main}
thrown in /in/r6rVc on line 56
Process exited with code 255 . Output for 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 Fatal error: Call to undefined function strip_surrounding_quotes() in /in/r6rVc on line 56
Process exited with code 255 . preferences:dark mode live preview
268.29 ms | 402 KiB | 373 Q