-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix Debug::getEscaper() never called at Debug::dump() when xdebug is loaded #5240
Changes from all commits
855cffa
cb9ef4a
3536622
726d5e9
dbdc92e
f74bc3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,11 +13,14 @@ | |
| }, | ||
| "target-dir": "Zend/Debug", | ||
| "require": { | ||
| "php": ">=5.3.3", | ||
| "zendframework/zend-escaper": "self.version" | ||
| "php": ">=5.3.3" | ||
| }, | ||
| "require-dev": { | ||
| "zendframework/zend-escaper": "*" | ||
| }, | ||
| "suggest": { | ||
| "ext/xdebug": "XDebug, for better backtrace output" | ||
| "ext/xdebug": "XDebug, for better backtrace output", | ||
| "zendframework/zend-escaper": "To support escaped output" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also needs to be in a "require-dev" section, as it's necessary for tests.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @weierophinney done, I've added to require-dev also. |
||
| }, | ||
| "extra": { | ||
| "branch-alias": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| namespace ZendTest; | ||
|
|
||
| use Zend\Debug\Debug; | ||
| use Zend\Escaper\Escaper; | ||
|
|
||
| /** | ||
| * @group Zend_Debug | ||
|
|
@@ -94,4 +95,14 @@ public function testXdebugEnabledAndNonCliSapiDoesNotEscapeSpecialChars() | |
| $this->assertContains("</pre>", $result); | ||
| } | ||
|
|
||
| public function testDebugHaveEscaper() | ||
| { | ||
| $escaper = new Escaper; | ||
| Debug::setEscaper($escaper); | ||
|
|
||
| $a = array("a" => "<script type=\"text/javascript\""); | ||
| $result = Debug::dump($a, "LABEL", false); | ||
| $this->assertContains("<script type="text/javascript""", $result); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually get a test failure here -- the actual content is not escaped...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @weierophinney this work on my machine and on travis too.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @weierophinney any suggestion for it ? thanks. |
||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this to
ext-xdebugon commit, as that's the proper format for extensions.