diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2014-03-18 18:25:42 +0000 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2014-03-18 18:25:42 +0000 |
commit | 177ef92c4ddd38cb906dd7d5f0208c698048cd57 (patch) | |
tree | 1ac59067a92789f3ae0196a93dd79d315a18e0b6 /inc | |
parent | 84abf1113fd407d4ffefe3313b8f0c3214f04b05 (diff) | |
parent | f8fb2d1811251304687b805a60b489f63cb5c4fb (diff) | |
download | rpg-177ef92c4ddd38cb906dd7d5f0208c698048cd57.tar.gz rpg-177ef92c4ddd38cb906dd7d5f0208c698048cd57.tar.bz2 |
Merge pull request #616 from splitbrain/stripsourcemaps
strip sourcemaps in CSS and JS #601
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 : |