Test Failed
Push — master ( 014002...9a5747 )
by Federico
01:51
created
dist/jate/modules/JConfig/JConfig.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -1,57 +1,57 @@
 block discarded – undo
1 1
 <?php
2 2
   class JConfig {
3
-    public $connection;
4
-    public $all;
5
-    public $DEBUG;
6
-    public $pages;
7
-    public $server;
8
-    public function __construct() {
9
-      $this->connection["enable"]    = false;
10
-      $this->connection["user"]      = "";
11
-      $this->connection["password"] = "";
12
-      $this->connection["database"] = "";
13
-      $this->connection["server"]    = "";
14
-      $this->all    = "";
15
-      $this->DEBUG  = 0;
16
-      $this->pages  = [];
17
-      $this->server  = [];
18
-      $this->server["HTTP_HOST"]    = $_SERVER["HTTP_HOST"];
19
-      $this->server["REQUEST_URI"]  = $_SERVER["REQUEST_URI"];
20
-      $this->server["PHP_SELF"]      = $_SERVER["PHP_SELF"];
21
-      $this->server["RELATIVE"]      = str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22
-    }
23
-    public function import( $_path, $_type = "misc" ) {
24
-      if(!file_exists($_path))
25
-        Debug::fatal("File [$_path] not found.");
26
-      $data = file_get_contents($_path);
27
-      $data = json_decode($data);
28
-      if($data === NULL)
29
-        Debug::fatal("Error processing [$_path]");
30
-      if( $_type == "connection" )
31
-        $this->overlayConnection($data);
32
-      else
33
-        $this->overlayMisc($data);
34
-    }
35
-    protected function overlayConnection( $_data ) {
36
-      $this->connection = $this->obj2array($_data);
37
-    }
38
-    protected function overlayMisc( $_data ) {
39
-      $this->importObject($_data);
40
-    }
41
-    protected function obj2array ( &$_instance ) {
42
-      $clone  = (array) $_instance;
43
-      $return  = [];
44
-      $return['___SOURCE_KEYS_'] = $clone;
45
-      while ( list ($key, $value) = each ($clone) ) {
46
-        $temp    = explode ("\0", $key);
47
-        $newkey  = $temp[count($temp)-1];
48
-        $return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
49
-      }
50
-      return $return;
51
-    }
52
-    protected function importObject( $_object ) {
53
-      foreach (get_object_vars($_object) as $key => $value)
54
-        $this->$key = $value;
55
-    }
3
+	public $connection;
4
+	public $all;
5
+	public $DEBUG;
6
+	public $pages;
7
+	public $server;
8
+	public function __construct() {
9
+	  $this->connection["enable"]    = false;
10
+	  $this->connection["user"]      = "";
11
+	  $this->connection["password"] = "";
12
+	  $this->connection["database"] = "";
13
+	  $this->connection["server"]    = "";
14
+	  $this->all    = "";
15
+	  $this->DEBUG  = 0;
16
+	  $this->pages  = [];
17
+	  $this->server  = [];
18
+	  $this->server["HTTP_HOST"]    = $_SERVER["HTTP_HOST"];
19
+	  $this->server["REQUEST_URI"]  = $_SERVER["REQUEST_URI"];
20
+	  $this->server["PHP_SELF"]      = $_SERVER["PHP_SELF"];
21
+	  $this->server["RELATIVE"]      = str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22
+	}
23
+	public function import( $_path, $_type = "misc" ) {
24
+	  if(!file_exists($_path))
25
+		Debug::fatal("File [$_path] not found.");
26
+	  $data = file_get_contents($_path);
27
+	  $data = json_decode($data);
28
+	  if($data === NULL)
29
+		Debug::fatal("Error processing [$_path]");
30
+	  if( $_type == "connection" )
31
+		$this->overlayConnection($data);
32
+	  else
33
+		$this->overlayMisc($data);
34
+	}
35
+	protected function overlayConnection( $_data ) {
36
+	  $this->connection = $this->obj2array($_data);
37
+	}
38
+	protected function overlayMisc( $_data ) {
39
+	  $this->importObject($_data);
40
+	}
41
+	protected function obj2array ( &$_instance ) {
42
+	  $clone  = (array) $_instance;
43
+	  $return  = [];
44
+	  $return['___SOURCE_KEYS_'] = $clone;
45
+	  while ( list ($key, $value) = each ($clone) ) {
46
+		$temp    = explode ("\0", $key);
47
+		$newkey  = $temp[count($temp)-1];
48
+		$return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
49
+	  }
50
+	  return $return;
51
+	}
52
+	protected function importObject( $_object ) {
53
+	  foreach (get_object_vars($_object) as $key => $value)
54
+		$this->$key = $value;
55
+	}
56 56
   }
57 57
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Parsedown/Parsedown.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -3,20 +3,20 @@
 block discarded – undo
3 3
   jRequire("Parsedown/Parsedown.php");
4 4
   use Parsedown as Parsedown;
5 5
   class Parsedown extends Module {
6
-    public function __construct() {
7
-      parent::__construct();
8
-    }
9
-    public function drawFile( $_template ) {
10
-      return $this->draw($_template);
11
-    }
12
-    public function drawText( $_template ) {
13
-      return $this->draw(trim($_template));
14
-    }
15
-    public function draw( $_template ) {
16
-      $Parsedown = new Parsedown\Parsedown();
17
-      $page = $Parsedown->text($_template);
18
-      $page = preg_replace('/[ ](?=[^>]*(?:<|$))/', "&nbsp", $page);
19
-      return $page;
20
-    }
6
+	public function __construct() {
7
+	  parent::__construct();
8
+	}
9
+	public function drawFile( $_template ) {
10
+	  return $this->draw($_template);
11
+	}
12
+	public function drawText( $_template ) {
13
+	  return $this->draw(trim($_template));
14
+	}
15
+	public function draw( $_template ) {
16
+	  $Parsedown = new Parsedown\Parsedown();
17
+	  $page = $Parsedown->text($_template);
18
+	  $page = preg_replace('/[ ](?=[^>]*(?:<|$))/', "&nbsp", $page);
19
+	  return $page;
20
+	}
21 21
   }
22 22
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionPostgresqlAdapter.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,51 +1,51 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPostgresqlAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8
-            or die('Could not connect: '.pg_last_error());
9
-        } catch( Exception $error ) {
10
-          Debug::fatal($error->getMessage());
11
-          exit();
12
-        }
13
-      }
14
-      public function query( $_query ) {
15
-        $this->stdQuery($_query);
16
-        return true;
17
-      }
18
-      public function queryInsert( $_query ) {
19
-        $this->stdQuery($_query);
20
-        return $this->stdQuery("SELECT lastval()");
21
-      }
22
-      public function queryFetch( $_query ) {
23
-        $result = $this->stdQuery($_query);
24
-        $rows = [];
25
-        while($row = pg_fetch_assoc($result))
26
-          $rows[] = $row;
27
-        pg_free_result($result);
28
-        return $rows;
29
-      }
30
-      public function queryArray( $_query ) {
31
-        $result = $this->stdQuery($_query);
32
-        $rows = [];
33
-        while($row = pg_fetch_array($result))
34
-          $rows[] = $row;
35
-        pg_free_result($result);
36
-        return $rows;
37
-      }
38
-      protected function stdQuery( $_query ) {
39
-        $database = $this->connection;
40
-        $result = pg_query($database, $_query);
41
-        if(!$result) {
42
-          Debug::fatalStack([
43
-            "query" => $_query,
44
-            "error" => pg_last_error()
45
-          ]);
46
-          exit();
47
-        }
48
-        return $result;
49
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8
+			or die('Could not connect: '.pg_last_error());
9
+		} catch( Exception $error ) {
10
+		  Debug::fatal($error->getMessage());
11
+		  exit();
12
+		}
13
+	  }
14
+	  public function query( $_query ) {
15
+		$this->stdQuery($_query);
16
+		return true;
17
+	  }
18
+	  public function queryInsert( $_query ) {
19
+		$this->stdQuery($_query);
20
+		return $this->stdQuery("SELECT lastval()");
21
+	  }
22
+	  public function queryFetch( $_query ) {
23
+		$result = $this->stdQuery($_query);
24
+		$rows = [];
25
+		while($row = pg_fetch_assoc($result))
26
+		  $rows[] = $row;
27
+		pg_free_result($result);
28
+		return $rows;
29
+	  }
30
+	  public function queryArray( $_query ) {
31
+		$result = $this->stdQuery($_query);
32
+		$rows = [];
33
+		while($row = pg_fetch_array($result))
34
+		  $rows[] = $row;
35
+		pg_free_result($result);
36
+		return $rows;
37
+	  }
38
+	  protected function stdQuery( $_query ) {
39
+		$database = $this->connection;
40
+		$result = pg_query($database, $_query);
41
+		if(!$result) {
42
+		  Debug::fatalStack([
43
+			"query" => $_query,
44
+			"error" => pg_last_error()
45
+		  ]);
46
+		  exit();
47
+		}
48
+		return $result;
49
+	  }
50 50
   }
51 51
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionMysqliAdapter.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionMysqliAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db );
8
-        } catch( Exception $error ) {
9
-          Debug::fatal($error->getMessage());
10
-          exit();
11
-        }
12
-      }
13
-      public function query( $_query ) {
14
-        $this->stdQuery($_query);
15
-        return true;
16
-      }
17
-      public function queryInsert( $_query ) {
18
-        $this->stdQuery($_query);
19
-        return $this->connection->insert_id;
20
-      }
21
-      public function queryFetch( $_query ) {
22
-        $result = $this->stdQuery($_query);
23
-        $rows = [];
24
-        while($row = $result->fetch_assoc())
25
-          $rows[] = $row;
26
-        return $rows;
27
-      }
28
-      public function queryArray( $_query ) {
29
-        $result = $this->stdQuery($_query);
30
-        $rows = [];
31
-        while($row = $result->fetch_array())
32
-          $rows[] = $row;
33
-        return $rows;
34
-      }
35
-      protected function stdQuery( $_query ) {
36
-        $database = $this->connection;
37
-        $result = $database->query($_query);
38
-        if(!$result) {
39
-          Debug::fatalStack([
40
-            "query" => $_query,
41
-            "error" => $database->error
42
-          ]);
43
-          exit();
44
-        }
45
-        return $result;
46
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db );
8
+		} catch( Exception $error ) {
9
+		  Debug::fatal($error->getMessage());
10
+		  exit();
11
+		}
12
+	  }
13
+	  public function query( $_query ) {
14
+		$this->stdQuery($_query);
15
+		return true;
16
+	  }
17
+	  public function queryInsert( $_query ) {
18
+		$this->stdQuery($_query);
19
+		return $this->connection->insert_id;
20
+	  }
21
+	  public function queryFetch( $_query ) {
22
+		$result = $this->stdQuery($_query);
23
+		$rows = [];
24
+		while($row = $result->fetch_assoc())
25
+		  $rows[] = $row;
26
+		return $rows;
27
+	  }
28
+	  public function queryArray( $_query ) {
29
+		$result = $this->stdQuery($_query);
30
+		$rows = [];
31
+		while($row = $result->fetch_array())
32
+		  $rows[] = $row;
33
+		return $rows;
34
+	  }
35
+	  protected function stdQuery( $_query ) {
36
+		$database = $this->connection;
37
+		$result = $database->query($_query);
38
+		if(!$result) {
39
+		  Debug::fatalStack([
40
+			"query" => $_query,
41
+			"error" => $database->error
42
+		  ]);
43
+		  exit();
44
+		}
45
+		return $result;
46
+	  }
47 47
   }
48 48
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionPdoAdapter.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,47 +1,47 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPdoAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $connection = "mysql:host=$_srv;dbname=$_db";
8
-          $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
-        } catch( Exception $error ) {
10
-          Debug::fatal($error->getMessage());
11
-          exit();
12
-        }
13
-      }
14
-      public function query( $_query ) {
15
-        $this->stdQuery($_query);
16
-        return true;
17
-      }
18
-      public function queryInsert( $_query ) {
19
-        $this->stdQuery($_query);
20
-        return $this->connection->lastInsertId();
21
-      }
22
-      public function queryFetch( $_query ) {
23
-        $temp = $this->stdQuery($_query);
24
-        return $temp->fetchAll(PDO::FETCH_ASSOC);
25
-      }
26
-      public function queryArray( $_query ) {
27
-        $temp = $this->stdQuery($_query);
28
-        return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29
-      }
30
-      protected function stdQuery( $_query ) {
31
-        $database = $this->connection;
32
-        $query = $database->prepare($_query);
33
-        $result = $query->execute();
34
-        if(!$result) {
35
-          Debug::fatalStack([
36
-            "query" => $_query,
37
-            "error" => [
38
-              $query->errorInfo(),
39
-              $database->errorInfo()
40
-            ]
41
-          ]);
42
-          exit();
43
-        }
44
-        return $query;
45
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $connection = "mysql:host=$_srv;dbname=$_db";
8
+		  $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
+		} catch( Exception $error ) {
10
+		  Debug::fatal($error->getMessage());
11
+		  exit();
12
+		}
13
+	  }
14
+	  public function query( $_query ) {
15
+		$this->stdQuery($_query);
16
+		return true;
17
+	  }
18
+	  public function queryInsert( $_query ) {
19
+		$this->stdQuery($_query);
20
+		return $this->connection->lastInsertId();
21
+	  }
22
+	  public function queryFetch( $_query ) {
23
+		$temp = $this->stdQuery($_query);
24
+		return $temp->fetchAll(PDO::FETCH_ASSOC);
25
+	  }
26
+	  public function queryArray( $_query ) {
27
+		$temp = $this->stdQuery($_query);
28
+		return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29
+	  }
30
+	  protected function stdQuery( $_query ) {
31
+		$database = $this->connection;
32
+		$query = $database->prepare($_query);
33
+		$result = $query->execute();
34
+		if(!$result) {
35
+		  Debug::fatalStack([
36
+			"query" => $_query,
37
+			"error" => [
38
+			  $query->errorInfo(),
39
+			  $database->errorInfo()
40
+			]
41
+		  ]);
42
+		  exit();
43
+		}
44
+		return $query;
45
+	  }
46 46
   }
47 47
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Debug/Debug.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,60 +1,60 @@
 block discarded – undo
1 1
 <?php
2 2
   class Debug {
3
-    public static $stack;
4
-    private static $initialized = false;
5
-    private function __construct() {}
6
-    private static function initialize() {
7
-      if (self::$initialized)
8
-        return;
9
-      self::$stack = [];
10
-      self::$initialized = true;
11
-    }
12
-    private static function out( $_object ) {
13
-      if(is_object($_object)) {
14
-        echo "isObject";
15
-      } else if(is_array($_object)) {
16
-        arrayDump($_object, "Debug");
17
-      } else {
18
-        echo $_object;
19
-      }
20
-    }
21
-    public static function error( $_object ) {
22
-      self::out(["Error" => $_object]);
23
-    }
24
-    public static function warning( $_object ) {
25
-      self::out(["Warning" => $_object]);
26
-    }
27
-    public static function fatal( $_object ) {
28
-      self::out(["Fatal error" => $_object]);
29
-      exit(1);
30
-    }
31
-    public static function logln( $_object ) {
32
-      self::log($_object);
33
-      self::out("<br>");
34
-    }
35
-    public static function logStack( $_object ) {
36
-      self::out([
37
-        "position" => self::$stack,
38
-        "error" => $_object
39
-      ]);
40
-      self::out("<br>");
41
-    }
42
-    public static function push() {
43
-      $debugInfo = debug_backtrace();
44
-      $debugInfo = [
45
-        "file" => $debugInfo[1]["file"],
46
-        "line" => $debugInfo[1]["line"],
47
-        "function" => $debugInfo[1]["function"],
48
-        "class" => $debugInfo[1]["class"]
49
-      ];
50
-      self::$stack[] = $debugInfo;
51
-    }
52
-    public static function pop() {
53
-      if(count(self::$stack)>0)
54
-        array_shift(self::$stack);
55
-    }
56
-    public static function emptyStack() {
57
-      self::$stack = [];
58
-    }
3
+	public static $stack;
4
+	private static $initialized = false;
5
+	private function __construct() {}
6
+	private static function initialize() {
7
+	  if (self::$initialized)
8
+		return;
9
+	  self::$stack = [];
10
+	  self::$initialized = true;
11
+	}
12
+	private static function out( $_object ) {
13
+	  if(is_object($_object)) {
14
+		echo "isObject";
15
+	  } else if(is_array($_object)) {
16
+		arrayDump($_object, "Debug");
17
+	  } else {
18
+		echo $_object;
19
+	  }
20
+	}
21
+	public static function error( $_object ) {
22
+	  self::out(["Error" => $_object]);
23
+	}
24
+	public static function warning( $_object ) {
25
+	  self::out(["Warning" => $_object]);
26
+	}
27
+	public static function fatal( $_object ) {
28
+	  self::out(["Fatal error" => $_object]);
29
+	  exit(1);
30
+	}
31
+	public static function logln( $_object ) {
32
+	  self::log($_object);
33
+	  self::out("<br>");
34
+	}
35
+	public static function logStack( $_object ) {
36
+	  self::out([
37
+		"position" => self::$stack,
38
+		"error" => $_object
39
+	  ]);
40
+	  self::out("<br>");
41
+	}
42
+	public static function push() {
43
+	  $debugInfo = debug_backtrace();
44
+	  $debugInfo = [
45
+		"file" => $debugInfo[1]["file"],
46
+		"line" => $debugInfo[1]["line"],
47
+		"function" => $debugInfo[1]["function"],
48
+		"class" => $debugInfo[1]["class"]
49
+	  ];
50
+	  self::$stack[] = $debugInfo;
51
+	}
52
+	public static function pop() {
53
+	  if(count(self::$stack)>0)
54
+		array_shift(self::$stack);
55
+	}
56
+	public static function emptyStack() {
57
+	  self::$stack = [];
58
+	}
59 59
   }
60 60
 ?>
Please login to merge, or discard this patch.
dist/jate/functions/block.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -3,59 +3,59 @@
 block discarded – undo
3 3
   jRequire("../modules/Parsedown/Parsedown.php");
4 4
   jRequire("../modules/Debug/Debug.php");
5 5
   function jBlock() {
6
-    return ob_start();
6
+	return ob_start();
7 7
   }
8 8
 
9 9
   function jBlockClose( $_type = "html", $_parameters = [] ) {
10
-    return jBlockEnd($_type, $_parameters);
10
+	return jBlockEnd($_type, $_parameters);
11 11
   }
12 12
 
13 13
   function jBlockFile( $_path, $_parameters = [] ) {
14
-    $extension = explode(".", $_path);
15
-    $extension = $extension[count($extension)-1];
16
-    $extension = strtolower($extension);
17
-    return jBlockFileMan($_path, $extension, $_parameters);
14
+	$extension = explode(".", $_path);
15
+	$extension = $extension[count($extension)-1];
16
+	$extension = strtolower($extension);
17
+	return jBlockFileMan($_path, $extension, $_parameters);
18 18
   }
19 19
 
20 20
   function jBlockFileMan( $_path, $_type, $_parameters = [] ) {
21
-    if(!file_exists($_path))
22
-      Debug::fatal("File [$_path] not found.");
23
-    $temp = file_get_contents($_path);
24
-    return jBlockParsing($_type, $temp, $_parameters);
21
+	if(!file_exists($_path))
22
+	  Debug::fatal("File [$_path] not found.");
23
+	$temp = file_get_contents($_path);
24
+	return jBlockParsing($_type, $temp, $_parameters);
25 25
   }
26 26
 
27 27
   function jBlockEnd( $_type = "html", $_parameters = [] ) {
28
-    $text = ob_get_clean();
29
-    return jBlockParsing($_type, $text, $_parameters);
28
+	$text = ob_get_clean();
29
+	return jBlockParsing($_type, $text, $_parameters);
30 30
   }
31 31
 
32 32
   function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) {
33
-    switch ($_type) {
34
-      case "pug":
35
-      case "jade":
36
-        $Pug = new Pug();
37
-        $_string = $Pug->drawText($_string, $_parameters);
38
-      break;
39
-      case "md":
40
-      case "markdown":
41
-      case "parsedown":
42
-        $Parsedown = new Parsedown();
43
-        $_string = $Parsedown->drawText($_string);
44
-      break;
45
-      case "twig":
46
-        $Twig = new Twig();
47
-        $_string = $Twig->drawText($_string, $_parameters);
48
-      break;
49
-      default: break;
50
-    }
51
-    return $_string;
33
+	switch ($_type) {
34
+	  case "pug":
35
+	  case "jade":
36
+		$Pug = new Pug();
37
+		$_string = $Pug->drawText($_string, $_parameters);
38
+	  break;
39
+	  case "md":
40
+	  case "markdown":
41
+	  case "parsedown":
42
+		$Parsedown = new Parsedown();
43
+		$_string = $Parsedown->drawText($_string);
44
+	  break;
45
+	  case "twig":
46
+		$Twig = new Twig();
47
+		$_string = $Twig->drawText($_string, $_parameters);
48
+	  break;
49
+	  default: break;
50
+	}
51
+	return $_string;
52 52
   }
53 53
 
54 54
   function minifyOutput($_buffer) {
55
-    $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
56
-    $replace = array ( '>', '<', '\\1' );
57
-    if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1)
58
-      $_buffer = preg_replace($search, $replace, utf8_decode($_buffer));
59
-    return utf8_encode($_buffer);
55
+	$search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
56
+	$replace = array ( '>', '<', '\\1' );
57
+	if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1)
58
+	  $_buffer = preg_replace($search, $replace, utf8_decode($_buffer));
59
+	return utf8_encode($_buffer);
60 60
   }
61 61
 ?>
Please login to merge, or discard this patch.