diff options
Diffstat (limited to 'inc/common.php')
-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 9fbebde94..5aacf6355 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1675,4 +1675,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 : |