summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2014-03-18 18:25:42 +0000
committerChristopher Smith <chris@jalakai.co.uk>2014-03-18 18:25:42 +0000
commit177ef92c4ddd38cb906dd7d5f0208c698048cd57 (patch)
tree1ac59067a92789f3ae0196a93dd79d315a18e0b6 /inc/common.php
parent84abf1113fd407d4ffefe3313b8f0c3214f04b05 (diff)
parentf8fb2d1811251304687b805a60b489f63cb5c4fb (diff)
downloadrpg-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/common.php')
-rw-r--r--inc/common.php9
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 :