Browse Source

Fix for double escaping of queries in the profiler

Sometimes the logged queries would be rendered with visible
HTML entities in the profiler, due to double encoding (You know,
> stuff). I could not find out why it was being escaped
twice, but I found an easy fix: since PHP 5.2.3 the htmlspecialchars
function had a double_encoding parameter that could be set
to false. Voilà!
Eugen 12 years ago
parent
commit
944d98d16e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      laravel/profiling/profiler.php

+ 2 - 2
laravel/profiling/profiler.php

@@ -146,9 +146,9 @@ class Profiler {
 		foreach ($bindings as $binding)
 		{
 			$binding = Database::escape($binding);
-
+			
 			$sql = preg_replace('/\?/', $binding, $sql, 1);
-			$sql = htmlspecialchars($sql);
+			$sql = htmlspecialchars($sql, ENT_QUOTES, 'UTF-8', false);
 		}
 
 		static::$data['queries'][] = array($sql, $time);