In
system/expressionengine/libraries/Template.php->_match_date_vars()
In previous versions the regex for matching date fields allowed for a colon:
if (preg_match_all("/".LD."([\w:\-]+)\s+format=[\"'](.*?)[\"']".RD."/", $str, $matches, PREG_SET_ORDER))
In EE 2.8 beta 2, the colon is removed for some reason:
if ($standard = preg_match_all("/".LD."([\w\-]+)\s+(format|timezone)=[\"'](.*?)[\"']".RD."/", $str, $matches, PREG_SET_ORDER))
I’m assuming that this is to allow for matching of the new ‘:relative’ keyword, but this breaks some longtime usage of colon prefixed vars that I know ourselves and DevDemon use off of the top of my head.
For instance: in EE 2.7.3,
{freeform:edit_date format="%Y-%m-%d"}
works when using TMPL->parse_variables. In EE 2.8 it does not due to the removal of the colon from the regex.
Thanks for catching this. I have adjusted the flow of that function catching relative dates first, and restored the colon when searching for other dates. This will be in the 2.8.0 release.
Here is the diff of the change:
diff --git a/system/expressionengine/libraries/Template.php b/system/expressionengine/libraries/Template.php
index 2c38e11..5b54dae 100644
--- a/system/expressionengine/libraries/Template.php
+++ b/system/expressionengine/libraries/Template.php
@@ -4146,15 +4146,14 @@ class EE_Template {
strpos($str, 'timezone=') !== FALSE ||
strpos($str, ':relative') !== FALSE)
{
- if ($standard = preg_match_all("/".LD."([\w\-]+)\s+(format|timezone)=[\"'](.*?)[\"']".RD."/", $str, $matches, PREG_SET_ORDER))
+ if ($relative = preg_match_all("/".LD."([\w\-]+):relative(.*?)".RD."/", $str, $matches, PREG_SET_ORDER))
{
foreach ($matches as $match)
{
$this->date_vars[] = $match[1];
}
}
-
- if ($relative = preg_match_all("/".LD."([\w\-]+):relative(.*?)".RD."/", $str, $matches, PREG_SET_ORDER))
+ elseif ($standard = preg_match_all("/".LD."([\w:\-]+)\s+(format|timezone)=[\"'](.*?)[\"']".RD."/", $str, $matches, PREG_SET_ORDER))
{
foreach ($matches as $match)
{
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.