projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
APIv4 - Add Address::getCoordinates action
[civicrm-core.git]
/
CRM
/
Utils
/
JS.php
diff --git
a/CRM/Utils/JS.php
b/CRM/Utils/JS.php
index 66c03e0f483d6175b3a8337723eb98d332cae5ed..27c4d4524525724a1d52b16eb9941e8da45d9b60 100644
(file)
--- a/
CRM/Utils/JS.php
+++ b/
CRM/Utils/JS.php
@@
-109,6
+109,10
@@
class CRM_Utils_JS {
* @return string
*/
public static function stripComments($script) {
* @return string
*/
public static function stripComments($script) {
+ // This function is a little naive, and some expressions may trip it up. Opt-out if anything smells fishy.
+ if (preg_match(';`\r?\n//;', $script)) {
+ return $script;
+ }
return preg_replace("#^\\s*//[^\n]*$(?:\r\n|\n)?#m", "", $script);
}
return preg_replace("#^\\s*//[^\n]*$(?:\r\n|\n)?#m", "", $script);
}
@@
-214,7
+218,7
@@
class CRM_Utils_JS {
* 'bar' => 'function() {return "bar";}',
* ]
*
* 'bar' => 'function() {return "bar";}',
* ]
*
- * @param $js
+ * @param
string
$js
* @return array
* @throws Exception
*/
* @return array
* @throws Exception
*/