Skip to content

Commit

Permalink
Fix debug output on only white spaced strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Hoffmann committed Feb 16, 2017
1 parent d90a98e commit e257dfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Error/Debugger.php
Expand Up @@ -513,7 +513,7 @@ protected static function _export($var, $depth, $indent)
case 'float':
return '(float) ' . $var;
case 'string':
if (trim($var) === '') {
if (trim($var) === '' && ctype_space($var) === false) {
return "''";
}

Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/Error/DebuggerTest.php
Expand Up @@ -280,6 +280,7 @@ public function testExportVar()
$View = $Controller->createView();
$View->int = 2;
$View->float = 1.333;
$View->string = ' ';

$result = Debugger::exportVar($View);
$expected = <<<TEXT
Expand Down Expand Up @@ -310,6 +311,7 @@ public function testExportVar()
Form => object(Cake\View\Helper\FormHelper) {}
int => (int) 2
float => (float) 1.333
string => ' '
[protected] _helpers => object(Cake\View\HelperRegistry) {}
[protected] _ext => '.ctp'
[protected] _passedVars => [
Expand Down

0 comments on commit e257dfb

Please sign in to comment.