Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.9.7
-
Component/s: ZendX_JQuery
-
Labels:None
-
Tags:
Description
In ZendX/JQuery/View/Helper/JQuery/Container.php - addJavascript($js) function, the first line is:
$js = preg_replace('/^\s*(.?)\s$/s', '$1', $js);
I believe this is simply trimming whitespace from either end. trim function would be more efficient.
Issue Links
| This issue is related to: | ||||
| ZF-8560 | remove unnecessary parameter manipulation in ZendX_JQuery_View_Helper_JQuery_Container::addJavascript() |
|
|
|
If $js is a very large string then addJavascript($js) fails to add $js as expected.
In my case (checking with preg_last_error) I had reached/exceeded the backtrack limit (PREG_BACKTRACK_LIMIT_ERROR).
Using trim() may be more efficient and would also remove this limit.