mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 22:26:31 +02:00
Handle CRLF discrepancies
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Index: src/PHPT/Case.php
|
||||
===================================================================
|
||||
--- src/PHPT/Case.php (revision 691)
|
||||
+++ src/PHPT/Case.php (working copy)
|
||||
@@ -28,17 +28,14 @@
|
||||
Index: src/PHPT/Case.php
|
||||
===================================================================
|
||||
--- src/PHPT/Case.php (revision 691)
|
||||
+++ src/PHPT/Case.php (working copy)
|
||||
@@ -28,17 +28,14 @@
|
||||
{
|
||||
$reporter->onCaseStart($this);
|
||||
try {
|
||||
@@ -26,7 +26,7 @@ Index: src/PHPT/Case.php
|
||||
}
|
||||
$reporter->onCasePass($this);
|
||||
} catch (PHPT_Case_VetoException $veto) {
|
||||
@@ -46,7 +43,6 @@
|
||||
@@ -46,7 +43,6 @@
|
||||
} catch (PHPT_Case_FailureException $failure) {
|
||||
$reporter->onCaseFail($this, $failure);
|
||||
}
|
||||
@@ -34,11 +34,11 @@ Index: src/PHPT/Case.php
|
||||
$reporter->onCaseEnd($this);
|
||||
}
|
||||
|
||||
Index: src/PHPT/Case/Validator/CgiRequired.php
|
||||
===================================================================
|
||||
--- src/PHPT/Case/Validator/CgiRequired.php (revision 691)
|
||||
+++ src/PHPT/Case/Validator/CgiRequired.php (working copy)
|
||||
@@ -17,7 +17,6 @@
|
||||
Index: src/PHPT/Case/Validator/CgiRequired.php
|
||||
===================================================================
|
||||
--- src/PHPT/Case/Validator/CgiRequired.php (revision 691)
|
||||
+++ src/PHPT/Case/Validator/CgiRequired.php (working copy)
|
||||
@@ -17,7 +17,6 @@
|
||||
public function is(PHPT_Case $case)
|
||||
{
|
||||
$return = $case->sections->filterByInterface('CgiExecutable')->valid();
|
||||
@@ -46,11 +46,11 @@ Index: src/PHPT/Case/Validator/CgiRequired.php
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Index: src/PHPT/CodeRunner/CommandLine.php
|
||||
===================================================================
|
||||
--- src/PHPT/CodeRunner/CommandLine.php (revision 691)
|
||||
+++ src/PHPT/CodeRunner/CommandLine.php (working copy)
|
||||
@@ -13,7 +13,7 @@
|
||||
Index: src/PHPT/CodeRunner/CommandLine.php
|
||||
===================================================================
|
||||
--- src/PHPT/CodeRunner/CommandLine.php (revision 691)
|
||||
+++ src/PHPT/CodeRunner/CommandLine.php (working copy)
|
||||
@@ -13,7 +13,7 @@
|
||||
$this->_filename = $runner->filename;
|
||||
$this->_ini = (string)$runner->ini;
|
||||
$this->_args = (string)$runner->args;
|
||||
@@ -59,45 +59,45 @@ Index: src/PHPT/CodeRunner/CommandLine.php
|
||||
$this->_post_filename = (string)$runner->post_filename;
|
||||
}
|
||||
|
||||
Index: src/PHPT/CodeRunner/Driver/WScriptShell.php
|
||||
===================================================================
|
||||
--- src/PHPT/CodeRunner/Driver/WScriptShell.php (revision 691)
|
||||
+++ src/PHPT/CodeRunner/Driver/WScriptShell.php (working copy)
|
||||
@@ -23,9 +23,9 @@
|
||||
}
|
||||
}
|
||||
if ($found == false) {
|
||||
- throw new PHPT_CodeRunner_InvalidExecutableException(
|
||||
- 'unable to locate PHP executable: ' . $this->executable
|
||||
- );
|
||||
+ //throw new PHPT_CodeRunner_InvalidExecutableException(
|
||||
+ // 'unable to locate PHP executable: ' . $this->executable
|
||||
+ //);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
$error = $this->_process->StdErr->ReadAll();
|
||||
if (!empty($error)) {
|
||||
- throw new PHPT_CodeRunner_ExecutionException($error);
|
||||
+ throw new PHPT_CodeRunner_ExecutionException($error, $this->_commandFactory());
|
||||
}
|
||||
|
||||
return $this->_process->StdOut->ReadAll();
|
||||
@@ -93,6 +93,7 @@
|
||||
{
|
||||
$return = '';
|
||||
foreach ($this->environment as $key => $value) {
|
||||
+ $value = str_replace('&', '^&', $value);
|
||||
$return .= "set {$key}={$value} & ";
|
||||
}
|
||||
return $return;
|
||||
Index: src/PHPT/CodeRunner/Factory.php
|
||||
===================================================================
|
||||
--- src/PHPT/CodeRunner/Factory.php (revision 691)
|
||||
+++ src/PHPT/CodeRunner/Factory.php (working copy)
|
||||
@@ -33,7 +33,13 @@
|
||||
Index: src/PHPT/CodeRunner/Driver/WScriptShell.php
|
||||
===================================================================
|
||||
--- src/PHPT/CodeRunner/Driver/WScriptShell.php (revision 691)
|
||||
+++ src/PHPT/CodeRunner/Driver/WScriptShell.php (working copy)
|
||||
@@ -23,9 +23,9 @@
|
||||
}
|
||||
}
|
||||
if ($found == false) {
|
||||
- throw new PHPT_CodeRunner_InvalidExecutableException(
|
||||
- 'unable to locate PHP executable: ' . $this->executable
|
||||
- );
|
||||
+ //throw new PHPT_CodeRunner_InvalidExecutableException(
|
||||
+ // 'unable to locate PHP executable: ' . $this->executable
|
||||
+ //);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
$error = $this->_process->StdErr->ReadAll();
|
||||
if (!empty($error)) {
|
||||
- throw new PHPT_CodeRunner_ExecutionException($error);
|
||||
+ throw new PHPT_CodeRunner_ExecutionException($error, $this->_commandFactory());
|
||||
}
|
||||
|
||||
return $this->_process->StdOut->ReadAll();
|
||||
@@ -93,6 +93,7 @@
|
||||
{
|
||||
$return = '';
|
||||
foreach ($this->environment as $key => $value) {
|
||||
+ $value = str_replace('&', '^&', $value);
|
||||
$return .= "set {$key}={$value} & ";
|
||||
}
|
||||
return $return;
|
||||
Index: src/PHPT/CodeRunner/Factory.php
|
||||
===================================================================
|
||||
--- src/PHPT/CodeRunner/Factory.php (revision 691)
|
||||
+++ src/PHPT/CodeRunner/Factory.php (working copy)
|
||||
@@ -33,7 +33,13 @@
|
||||
'php-cgi';
|
||||
}
|
||||
|
||||
@@ -112,11 +112,11 @@ Index: src/PHPT/CodeRunner/Factory.php
|
||||
$runner->executable = $runner->executable . '.exe';
|
||||
}
|
||||
try {
|
||||
Index: src/PHPT/Section/ModifiableAbstract.php
|
||||
===================================================================
|
||||
--- src/PHPT/Section/ModifiableAbstract.php (revision 691)
|
||||
+++ src/PHPT/Section/ModifiableAbstract.php (working copy)
|
||||
@@ -15,12 +15,10 @@
|
||||
Index: src/PHPT/Section/ModifiableAbstract.php
|
||||
===================================================================
|
||||
--- src/PHPT/Section/ModifiableAbstract.php (revision 691)
|
||||
+++ src/PHPT/Section/ModifiableAbstract.php (working copy)
|
||||
@@ -15,12 +15,10 @@
|
||||
|
||||
public function run(PHPT_Case $case)
|
||||
{
|
||||
@@ -133,11 +133,11 @@ Index: src/PHPT/Section/ModifiableAbstract.php
|
||||
}
|
||||
}
|
||||
|
||||
Index: src/PHPT/Section/SKIPIF.php
|
||||
===================================================================
|
||||
--- src/PHPT/Section/SKIPIF.php (revision 691)
|
||||
+++ src/PHPT/Section/SKIPIF.php (working copy)
|
||||
@@ -3,10 +3,12 @@
|
||||
Index: src/PHPT/Section/SKIPIF.php
|
||||
===================================================================
|
||||
--- src/PHPT/Section/SKIPIF.php (revision 691)
|
||||
+++ src/PHPT/Section/SKIPIF.php (working copy)
|
||||
@@ -3,10 +3,12 @@
|
||||
class PHPT_Section_SKIPIF implements PHPT_Section_RunnableBefore
|
||||
{
|
||||
private $_data = null;
|
||||
@@ -150,7 +150,7 @@ Index: src/PHPT/Section/SKIPIF.php
|
||||
}
|
||||
|
||||
public function run(PHPT_Case $case)
|
||||
@@ -16,9 +18,7 @@
|
||||
@@ -16,9 +18,7 @@
|
||||
|
||||
// @todo refactor to PHPT_CodeRunner
|
||||
file_put_contents($filename, $this->_data);
|
||||
@@ -161,11 +161,11 @@ Index: src/PHPT/Section/SKIPIF.php
|
||||
unlink($filename);
|
||||
|
||||
if (preg_match('/^skip( - (.*))?/', $response, $matches)) {
|
||||
Index: src/PHPT/SectionList.php
|
||||
===================================================================
|
||||
--- src/PHPT/SectionList.php (revision 691)
|
||||
+++ src/PHPT/SectionList.php (working copy)
|
||||
@@ -2,7 +2,6 @@
|
||||
Index: src/PHPT/SectionList.php
|
||||
===================================================================
|
||||
--- src/PHPT/SectionList.php (revision 691)
|
||||
+++ src/PHPT/SectionList.php (working copy)
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
class PHPT_SectionList implements Iterator
|
||||
{
|
||||
@@ -173,7 +173,7 @@ Index: src/PHPT/SectionList.php
|
||||
private $_sections = array();
|
||||
private $_section_map = array();
|
||||
private $_key_map = array();
|
||||
@@ -15,14 +14,12 @@
|
||||
@@ -15,14 +14,12 @@
|
||||
}
|
||||
$name = strtoupper(str_replace('PHPT_Section_', '', get_class($section)));
|
||||
$key = $section instanceof PHPT_Section_Runnable ? $section->getPriority() . '.' . $name : $name;
|
||||
@@ -190,7 +190,7 @@ Index: src/PHPT/SectionList.php
|
||||
}
|
||||
|
||||
public function current()
|
||||
@@ -52,21 +49,23 @@
|
||||
@@ -52,21 +49,23 @@
|
||||
|
||||
public function filterByInterface($interface = null)
|
||||
{
|
||||
@@ -220,7 +220,7 @@ Index: src/PHPT/SectionList.php
|
||||
}
|
||||
|
||||
public function has($name)
|
||||
@@ -74,11 +73,11 @@
|
||||
@@ -74,11 +73,11 @@
|
||||
if (!isset($this->_section_map[$name])) {
|
||||
return false;
|
||||
}
|
||||
@@ -234,11 +234,11 @@ Index: src/PHPT/SectionList.php
|
||||
+ return $this->_sections[$this->_section_map[$key]];
|
||||
}
|
||||
}
|
||||
Index: tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt
|
||||
===================================================================
|
||||
--- tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (revision 691)
|
||||
+++ tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (working copy)
|
||||
@@ -17,9 +17,9 @@
|
||||
Index: tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt
|
||||
===================================================================
|
||||
--- tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (revision 691)
|
||||
+++ tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (working copy)
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
// sanity check
|
||||
$obj = new FoobarIni();
|
||||
@@ -250,11 +250,11 @@ Index: tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt
|
||||
unset($obj);
|
||||
|
||||
|
||||
Index: tests/Section/File/restores-case-sections.phpt
|
||||
===================================================================
|
||||
--- tests/Section/File/restores-case-sections.phpt (revision 691)
|
||||
+++ tests/Section/File/restores-case-sections.phpt (working copy)
|
||||
@@ -1,24 +0,0 @@
|
||||
Index: tests/Section/File/restores-case-sections.phpt
|
||||
===================================================================
|
||||
--- tests/Section/File/restores-case-sections.phpt (revision 691)
|
||||
+++ tests/Section/File/restores-case-sections.phpt (working copy)
|
||||
@@ -1,24 +0,0 @@
|
||||
---TEST--
|
||||
-After PHPT_Section_FILE::run(), the sections property of the provide $case object
|
||||
-is restored to its unfiltered state
|
||||
@@ -279,11 +279,11 @@ Index: tests/Section/File/restores-case-sections.phpt
|
||||
-===DONE===
|
||||
---EXPECT--
|
||||
-===DONE===
|
||||
Index: tests/SectionList/filter-by-interface.phpt
|
||||
===================================================================
|
||||
--- tests/SectionList/filter-by-interface.phpt (revision 691)
|
||||
+++ tests/SectionList/filter-by-interface.phpt (working copy)
|
||||
@@ -17,10 +17,10 @@
|
||||
Index: tests/SectionList/filter-by-interface.phpt
|
||||
===================================================================
|
||||
--- tests/SectionList/filter-by-interface.phpt (revision 691)
|
||||
+++ tests/SectionList/filter-by-interface.phpt (working copy)
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
$data = array_merge($runnable, $non_runnable);
|
||||
$list = new PHPT_SectionList($data);
|
||||
@@ -298,11 +298,11 @@ Index: tests/SectionList/filter-by-interface.phpt
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
Index: tests/SectionList/filter-resets-with-null.phpt
|
||||
===================================================================
|
||||
--- tests/SectionList/filter-resets-with-null.phpt (revision 691)
|
||||
+++ tests/SectionList/filter-resets-with-null.phpt (working copy)
|
||||
@@ -1,36 +0,0 @@
|
||||
Index: tests/SectionList/filter-resets-with-null.phpt
|
||||
===================================================================
|
||||
--- tests/SectionList/filter-resets-with-null.phpt (revision 691)
|
||||
+++ tests/SectionList/filter-resets-with-null.phpt (working copy)
|
||||
@@ -1,36 +0,0 @@
|
||||
---TEST--
|
||||
-If you call filterByInterface() with null or no-value, the full dataset is restored
|
||||
---FILE--
|
||||
@@ -339,11 +339,11 @@ Index: tests/SectionList/filter-resets-with-null.phpt
|
||||
-===DONE===
|
||||
---EXPECT--
|
||||
-===DONE===
|
||||
Index: tests/Util/Code/runAsFile-executes-in-file.phpt
|
||||
===================================================================
|
||||
--- tests/Util/Code/runAsFile-executes-in-file.phpt (revision 691)
|
||||
+++ tests/Util/Code/runAsFile-executes-in-file.phpt (working copy)
|
||||
@@ -10,7 +10,7 @@
|
||||
Index: tests/Util/Code/runAsFile-executes-in-file.phpt
|
||||
===================================================================
|
||||
--- tests/Util/Code/runAsFile-executes-in-file.phpt (revision 691)
|
||||
+++ tests/Util/Code/runAsFile-executes-in-file.phpt (working copy)
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
$util = new PHPT_Util_Code($code);
|
||||
|
||||
@@ -352,11 +352,11 @@ Index: tests/Util/Code/runAsFile-executes-in-file.phpt
|
||||
$result = $util->runAsFile($file);
|
||||
|
||||
assert('$result == $file');
|
||||
Index: tests/Util/Code/runAsFile-returns-output-if-no-return.phpt
|
||||
===================================================================
|
||||
--- tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (revision 691)
|
||||
+++ tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (working copy)
|
||||
@@ -9,7 +9,7 @@
|
||||
Index: tests/Util/Code/runAsFile-returns-output-if-no-return.phpt
|
||||
===================================================================
|
||||
--- tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (revision 691)
|
||||
+++ tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (working copy)
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
$util = new PHPT_Util_Code($code);
|
||||
|
||||
|
Reference in New Issue
Block a user