From 47e1ddf25bd4355dbc25144dd583983613de4363 Mon Sep 17 00:00:00 2001 From: Gilles Paquette Date: Thu, 28 Nov 2013 09:42:58 -0500 Subject: [PATCH 1/2] Fix for issue 6 When outerText() get a TEXT node it will convert the text using the convert_text() method to ensure it is utf-8 complient. --- Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php index 9a7b2f6..cce98be 100644 --- a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php +++ b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php @@ -384,8 +384,8 @@ function outertext() call_user_func_array($this->dom->callback, array($this)); } - if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER]; - if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + if (isset($this->_[HDOM_INFO_OUTER])) return $this->convert_tetxt($this->_[HDOM_INFO_OUTER]); + if (isset($this->_[HDOM_INFO_TEXT])) return $this->convert_text($this->dom->restore_noise($this->_[HDOM_INFO_TEXT])); // render begin tag if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) @@ -1718,4 +1718,4 @@ function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);} function loadFile() {$args = func_get_args();$this->load_file($args);} } -?> \ No newline at end of file +?> From 5496d7d3ddb835c380b9eca094d31459338c3a20 Mon Sep 17 00:00:00 2001 From: Gilles Paquette Date: Thu, 28 Nov 2013 13:21:38 -0500 Subject: [PATCH 2/2] fixed a typo tetxt => text --- Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php index cce98be..132b7c4 100644 --- a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php +++ b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php @@ -384,7 +384,7 @@ function outertext() call_user_func_array($this->dom->callback, array($this)); } - if (isset($this->_[HDOM_INFO_OUTER])) return $this->convert_tetxt($this->_[HDOM_INFO_OUTER]); + if (isset($this->_[HDOM_INFO_OUTER])) return $this->convert_text($this->_[HDOM_INFO_OUTER]); if (isset($this->_[HDOM_INFO_TEXT])) return $this->convert_text($this->dom->restore_noise($this->_[HDOM_INFO_TEXT])); // render begin tag