1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Merge branch '3.2.x'

This commit is contained in:
Máté Bartus
2017-09-07 15:09:40 +02:00
7 changed files with 127 additions and 11 deletions

View File

@@ -137,6 +137,10 @@ class redis extends \phpbb\cache\driver\memory
*/
function _write($var, $data, $ttl = 2592000)
{
if ($ttl == 0)
{
return $this->redis->set($var, $data);
}
return $this->redis->setex($var, $ttl, $data);
}

View File

@@ -521,7 +521,9 @@ class factory implements \phpbb\textformatter\cache_interface
protected function extract_templates($template)
{
// Capture the template fragments
preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END .*? -->#s', $template, $matches, PREG_SET_ORDER);
// Allow either phpBB template or the Twig syntax
preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END .*? -->#s', $template, $matches, PREG_SET_ORDER) ?:
preg_match_all('#{% for (.*?) in .*? %}(.*?){% endfor %}#s', $template, $matches, PREG_SET_ORDER);
$fragments = array();
foreach ($matches as $match)