File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,8 @@ public function __construct()
7070 public function __get ($ key )
7171 {
7272 // check attribute first
73- if ( ! is_null ($ this ->getAttribute ($ key ))) {
74- return $ this -> getAttribute ( $ key ) ;
73+ if ( ! is_null ($ value = $ this ->getAttribute ($ key ))) {
74+ return $ value ;
7575 }
7676 switch (strtolower ($ key )) {
7777 case 'outerhtml ' :
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ public function setAttribute($key, $value)
146146 $ value = [
147147 'value ' => $ value ,
148148 'doubleQuote ' => true ,
149+ 'didConvertCharset ' => true ,
149150 ];
150151 }
151152 $ this ->attr [$ key ] = $ value ;
@@ -217,9 +218,10 @@ public function getAttribute($key)
217218 return null ;
218219 }
219220 $ value = $ this ->attr [$ key ]['value ' ];
220- if (is_string ($ value ) && ! is_null ($ this ->encode )) {
221+ if (is_string ($ value ) && ! is_null ($ this ->encode ) && ! ( $ this -> attr [ $ key ][ ' didConvertCharset ' ] ?? false ) ) {
221222 // convert charset
222223 $ this ->attr [$ key ]['value ' ] = $ this ->encode ->convert ($ value );
224+ $ this ->attr [$ key ]['didConvertCharset ' ] = true ;
223225 }
224226
225227 return $ this ->attr [$ key ];
You can’t perform that action at this time.
0 commit comments