PHP has a recursion limit and random_bytes on PHP5.6 without openssl
will error if sent a large value. Using a loop has lower overhead than
recursion as well.
PHP7 doesn't have any default XHProf support and all other
investigated forks don't have stable PHP7. Tideways is under
active development and is easy to install. The data format
is compatible with XHProf so it is a drop-in replacement in that way.
This also has a couple of bugfixes:
- file_info_context_system::get_children() was looking for courses with parent=0, it is impossible, block removed;
- file_info_context_coursecat::get_area_coursecat_description() was checking the wrong capability to view files in description
When using a different theme and removing an editor
plugin such as the equation plugin, atto will display
an error about a missing dependency.
A thank you to Anthony Forth for providing this patch.
Mustache JS helper can overwrite JS blocks when using nested templates.
Each call to render should have it's own scope.
Conflicts:
lib/amd/build/templates.min.js
lib/amd/src/templates.js
Backported from MDL-53667 to make cherry-picking easier across branches.
The native String.replace method in extremely slow when we are
dealing with a large string and large quantity of strings to replace.
This new solution walks through the string looking for placeholders
to replace.
This commit just:
- Moves the null => '' to better place, restricting it to PHP >= 7.0
(bug https://bugs.php.net/bug.php?id=72524)
- Adds a couple of notes here and there.
- Changes some small details to keep the file using the same coding.
While searching for existing files if directory
separator is not correct then original files
and directories will be deleted. So use DIRECTORY_SEPARATOR.
Specifically on paste - we don't need all the random style attributes
from content on the clipboard. When you copy from a webpage - the browser
inlines all the styles from the page so that the pasted content will look
like the place it was copied from. But this is never what you want - you
want the content on paste, but with no special styling.
Upstream: https://github.com/ADOdb/ADOdb/pull/259
Prevent segfault with ocipo driver on php7.
The OCIFetchinto function is causing segfaults on php7 - probably because the fields array
is not initialised or it is optimised out. This fixes just changes to use the safer function
oci_fetch_array instead.
The JS blocks in a template must _not_ use a shared variable as they can be
executed asynchronously and complete in any order.
Instead it is stored in the only local variable available - the current
context.
Since the context can be passed in from elsewhere, we namespace it to
reduce the chance of collission.
These are our bugs actually - the oci docs are very clear that bound
params should be in-scope when oci_execute is called - and due to pass by value etc,
this was not true for our driver.
There is another bug that needed fixing - OCI barfs if null values are bound - this
can be avoided by setting them to '' which oci treats as null.
And finally - all our lob/clob/blob hacks were also binding to local "out-of-scope" vars.
This functionality was commented out in
78946b9bdb for MDL-20204 back in 2009.
Since then it has been wasting cycles performing utterly pointless
preg_match and preg_replace calls.