Skip to content

Commit 72245eb

Browse files
committed
Making debug() not html escape in cli contexts.
1 parent 19bcec5 commit 72245eb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cake/basics.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
9898
if (php_sapi_name() == 'cli') {
9999
$template = $text;
100100
}
101-
if ($showHtml === null) {
101+
if ($showHtml === null && $template !== $text) {
102102
$showHtml = true;
103103
}
104104
$var = print_r($var, true);

cake/tests/cases/basics.test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ public function testDebug() {
683683
$this->assertPattern($pattern, $result);
684684

685685
ob_start();
686-
debug('<div>this-is-a-test</div>');
686+
debug('<div>this-is-a-test</div>', true);
687687
$result = ob_get_clean();
688688
$pattern = '/(.+?tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
689689
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
@@ -761,7 +761,7 @@ public function testStripslashesDeep() {
761761
* @return void
762762
*/
763763
public function testStripslashesDeepSybase() {
764-
$this->skipUnless(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is off');
764+
$this->skipUnless(ini_get('magic_quotes_sybase') === '1', 'magic_quotes_sybase is off');
765765

766766
$this->assertEqual(stripslashes_deep("tes\'t"), "tes\'t");
767767

0 commit comments

Comments
 (0)