From dd74fecfdfa05c8e95162678c00d3da3ba3dad6d Mon Sep 17 00:00:00 2001
From: Michael Hamann <michael@content-space.de>
Date: Sat, 8 Sep 2012 12:53:09 +0200
Subject: [PATCH] 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.
---
 inc/confutils.php | 3 +++
 1 file changed, 3 insertions(+)

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);
-- 
GitLab