@@ -182,7 +182,9 @@ public function addContent($content, $type = null)
182
182
public function addHtmlContent ($ content , $ charset = 'UTF-8 ' )
183
183
{
184
184
$ internalErrors = libxml_use_internal_errors (true );
185
- $ disableEntities = libxml_disable_entity_loader (true );
185
+ if (LIBXML_VERSION < 20900 ) {
186
+ $ disableEntities = libxml_disable_entity_loader (true );
187
+ }
186
188
187
189
$ dom = new \DOMDocument ('1.0 ' , $ charset );
188
190
$ dom ->validateOnParse = true ;
@@ -203,7 +205,9 @@ public function addHtmlContent($content, $charset = 'UTF-8')
203
205
}
204
206
205
207
libxml_use_internal_errors ($ internalErrors );
206
- libxml_disable_entity_loader ($ disableEntities );
208
+ if (LIBXML_VERSION < 20900 ) {
209
+ libxml_disable_entity_loader ($ disableEntities );
210
+ }
207
211
208
212
$ this ->addDocument ($ dom );
209
213
@@ -246,7 +250,9 @@ public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NO
246
250
}
247
251
248
252
$ internalErrors = libxml_use_internal_errors (true );
249
- $ disableEntities = libxml_disable_entity_loader (true );
253
+ if (LIBXML_VERSION < 20900 ) {
254
+ $ disableEntities = libxml_disable_entity_loader (true );
255
+ }
250
256
251
257
$ dom = new \DOMDocument ('1.0 ' , $ charset );
252
258
$ dom ->validateOnParse = true ;
@@ -256,7 +262,9 @@ public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NO
256
262
}
257
263
258
264
libxml_use_internal_errors ($ internalErrors );
259
- libxml_disable_entity_loader ($ disableEntities );
265
+ if (LIBXML_VERSION < 20900 ) {
266
+ libxml_disable_entity_loader ($ disableEntities );
267
+ }
260
268
261
269
$ this ->addDocument ($ dom );
262
270
0 commit comments