fras.marco
New Member
If in the search string the user imputs a "/" character the regex broke. Apache error message:
PHP Warning: preg_match(): Unknown modifier ')' in [joomla folder]/components
/com_fabrik/models/elementlist.php on line 559, referer: [omissis]index.php/home/load-request/form/7/
To resolve, I modified the assignment of the regex in the file /components/com_fabrik/models/elementlist.php, line 546 onwards, BEFORE:
AFTER:
The problem is that addslashes doesn't quote the forward slash, so I simply added this quoting.
Steps to reproduce:
Create a list with an element containing strings, populate them with path-like strings, eg:
/usr/bin
/usr/share
in another list create a databasejoin element rendered as autocomplete pointing to that list and try a search string containg a /(eg /usr).
Can this bug be fixed in the next update?
thank you.
PHP Warning: preg_match(): Unknown modifier ')' in [joomla folder]/components
/com_fabrik/models/elementlist.php on line 559, referer: [omissis]index.php/home/load-request/form/7/
To resolve, I modified the assignment of the regex in the file /components/com_fabrik/models/elementlist.php, line 546 onwards, BEFORE:
PHP:
// Search for every word separately in the result rather than the single string (of multiple words)
$regex = "/(?=.*" .
implode(")(?=.*",
array_filter(explode(" ", addslashes($v)))
) . ").*/i";
PHP:
// Search for every word separately in the result rather than the single string (of multiple words)
$regex = "/(?=.*" .
implode(")(?=.*",
array_filter(explode(" ", str_replace('/', '\/', addslashes($v))))
) . ").*/i";
Steps to reproduce:
Create a list with an element containing strings, populate them with path-like strings, eg:
/usr/bin
/usr/share
in another list create a databasejoin element rendered as autocomplete pointing to that list and try a search string containg a /(eg /usr).
Can this bug be fixed in the next update?
thank you.