diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/common.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/inc/common.php b/inc/common.php index 5960d414e..110b91417 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1775,4 +1775,13 @@ function set_doku_pref($pref, $val) { } } +/** + * Strips source mapping declarations from given text #601 + * + * @param &string $text reference to the CSS or JavaScript code to clean + */ +function stripsourcemaps(&$text){ + $text = preg_replace('/^(\/\/|\/\*)[@#]\s+sourceMappingURL=.*?(\*\/)?$/im', '\\1\\2', $text); +} + //Setup VIM: ex: et ts=2 : |