Skip to content

Commit

Permalink
Making debug() not html escape in cli contexts.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 26, 2011
1 parent 19bcec5 commit 72245eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cake/basics.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
if (php_sapi_name() == 'cli') {
$template = $text;
}
if ($showHtml === null) {
if ($showHtml === null && $template !== $text) {
$showHtml = true;
}
$var = print_r($var, true);
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/basics.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ public function testDebug() {
$this->assertPattern($pattern, $result);

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

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

Expand Down

0 comments on commit 72245eb

Please sign in to comment.