The template stream filter no longer depends on the $config global.
Instead it uses a 'allow_php' param that is passed via
stream_bucket_append's last argument.
Tests also adjusted.
PHPBB3-9726
When testing eval code path, compiled templates may not be written
to the file system, and unconditionally trying to copy them
breaks tests.
PHPBB3-9726
compile_tag_if had the flawed approach of adding an isset statement for
all variables to the beginning of the if. This fails for negative
expressions, and checking those takes a considerable effort.
The easier solution is to make the variable expression itself
conditional, defaulting to null if it is not set.
Thanks to naderman for the solution.
PHPBB3-9726
This currently does not pass, thus it is commented out.
The reuse appears implausible in the same file, however it may be
also done across template files where it is much harder to detect.
PHPBB3-9726
This error resulted in a dot from the namespace being placed into
variable reference in compiled template code, thus creating bogus
compiled template code.
PHPBB3-9726
This currently fails.
This test is a reduced version of permission_mask template in acp, which
is not correctly compiled by the current template engine code.
PHPBB3-9726
phpbb_template_compile is now much simpler. It takes complete file paths
as inputs, either source template path or source template path and output
compiled template path. The number of methods also went down to two -
compile template and returned compiled text or compile and write to file.
phpbb_compile class is responsible for determining source and compiled
paths. It already had all the data necessary for this, now the code is
in the same place as the data it uses.
PHPBB3-9726
Do not change $recompile from true to false - any recompilation
condition alone is sufficient to force recompilation.
Also uncomment the nonexistent file test which passes with this fix.
PHPBB3-9726
Due to the usage of `__DIR__` for the file includes the tests can't
be ran on systems with PHP < 5.3. Replace all occurances of
`__DIR__` with `dirname(__FILE__)`.
PHPBB3-10011
The template tests disable NOTICEs for the duration of template execution since
the current version of the template engine does not generate sufficiently clean
code. The error level is reset aftwards, however that part is skipped when
trigger_error is called which is converted into a regular exception by PHPUnit
and passed down until caught. Such exceptions are now caught to reset the error
level, and then the exception is rethrown.
This uncovered another issue in the template tests which only passed because
NOTICEs were unintentionally disabled at this point. assign_display is also
required to operate without NOTICEs. The respective code has been added around
its callee as well. However no handling of exceptions takes place there. If
another test checking for errors in that function is ever added similar catch
logic will have to be added there.
PHPBB3-9701
This commit also ports all ascraeus tests to the new format.
Conflicts:
tests/all_tests.php
tests/network/all_tests.php
tests/request/all_tests.php
tests/request/request_var.php
tests/template/templates/includephp.html
* develop-olympus: (57 commits)
Revert "[ticket/7716] Data too long for column 'message_subject'"
[ticket/7716] Data too long for column 'message_subject'
[ticket/9780] Adding unit tests for gen_rand_string().
[ticket/9780] Add length check back to gen_rand_string().
[ticket/7972] Copying topics in the MCP now indexes the new topic.
[ticket/9782] Board disable radio set on when server load high
[ticket/9635] Useless parameter $data['post_time'] in function submit_post.
[ticket/9104] Safari does not display box headers correctly in the ACP.
[ticket/9777] Print error message in pre-commit hook when php is not installed.
[ticket/7716] Data too long for column 'message_subject'
[task/git-tools] Ignore git commit message comments
[task/git-tools] Adjust the hook to enforce that a ticket is always mentioned
[task/git-tools] Vastly expanded commit-msg hook.
[task/git-tools] Beginnings of a syntax checking hook.
[task/git-tools] Append ticket identifier to commit message prior to editing.
[ticket/7332] Redirect users back to post details when performing actions.
[ticket/7332] Collapse post details content down to a maximum of 300px heigh
[ticket/9771] Remove query string parameters that have no name.
[ticket/9760] Remove unrestricted wildcards from search terms.
[ticket/9599] Reimplement phpbb_checkdnsrr() function.
...
Conflicts:
tests/template/template.php
* develop-olympus:
[develop-olympus] Make this test run on windows with backslash-paths.
[bug/56965] Redirect fails with directory traversal
[bug/58685] Correct spelling errors in append_sid() comments.
[bug/58025] Search robots are now redirected if they send a SID in the request
The feature branch for the new template engine should probably
contain all the deleted tests as well. We should look into the
incompatibilities and try to stay backwards compatible.