We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 968f04a commit 55aa4ecCopy full SHA for 55aa4ec
src/PHPHtmlParser/Dom/Tag.php
@@ -98,11 +98,14 @@ public function noise($noise)
98
*/
99
public function setAttribute($key, $value)
100
{
101
- // convert charset
102
- $encode = new Encode;
103
- $encode->from(Dom::$expectedCharset);
104
- $encode->to(Dom::$charset);
105
- $value['value'] = $encode->convert($value['value']);
+ if (is_string($value['value']))
+ {
+ // convert charset
+ $encode = new Encode;
+ $encode->from(Dom::$expectedCharset);
106
+ $encode->to(Dom::$charset);
107
+ $value['value'] = $encode->convert($value['value']);
108
+ }
109
110
$this->attr[$key] = $value;
111
return $this;
0 commit comments