summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-09-08 12:53:09 +0200
committerMichael Hamann <michael@content-space.de>2012-09-08 14:34:57 +0200
commitdd74fecfdfa05c8e95162678c00d3da3ba3dad6d (patch)
tree95432c9c25b3be12623a204a70e34cb0b7b78833 /inc
parentad739841082515fdacb61ae6b7abcde1dcd9ce1f (diff)
downloadrpg-dd74fecfdfa05c8e95162678c00d3da3ba3dad6d.tar.gz
rpg-dd74fecfdfa05c8e95162678c00d3da3ba3dad6d.tar.bz2
Remove BOM in linesToHash, partial fix for FS#2464
The BOM at the beginning of some plugin.info.txt files prevented the plugin manager from correctly reading the base property and thus it installed the plugin in the wrong directory.
Diffstat (limited to 'inc')
-rw-r--r--inc/confutils.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/inc/confutils.php b/inc/confutils.php
index edea80092..404cc6050 100644
--- a/inc/confutils.php
+++ b/inc/confutils.php
@@ -143,6 +143,9 @@ function getSchemes() {
*/
function linesToHash($lines, $lower=false) {
$conf = array();
+ // remove BOM
+ if (isset($lines[0]) && substr($lines[0],0,3) == pack('CCC',0xef,0xbb,0xbf))
+ $lines[0] = substr($lines[0],3);
foreach ( $lines as $line ) {
//ignore comments (except escaped ones)
$line = preg_replace('/(?<![&\\\\])#.*$/','',$line);