File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -293,10 +293,10 @@ protected function callSmartemailingApiWithCurl($data) {
293293 return $ this ->getErrorXml ($ e ->getCode (), $ e ->getMessage ());
294294 }
295295
296+ $ xml = simplexml_load_string ($ response );
296297
297- if ($ this ->isValidXmlString ($ response )) {
298- return new \SimpleXMLElement ($ response );
299-
298+ if ($ xml !== FALSE ) {
299+ return $ xml ;
300300 } else {
301301 return $ this ->getErrorXml ('500 ' , 'Unknown Smartemailing API error. ' );
302302 }
@@ -319,25 +319,4 @@ public function getErrorXml($code, $message) {
319319 return $ xml ;
320320 }
321321
322-
323- /**
324- * check if xml string is valid
325- *
326- * @param string $xmlString
327- * @return bool
328- */
329- protected function isValidXmlString ($ xmlString ) {
330- libxml_use_internal_errors (TRUE );
331-
332- $ doc = simplexml_load_string ($ xmlString );
333-
334- if (!$ doc ) {
335- $ errors = libxml_get_errors ();
336-
337- return empty ($ errors );
338- }
339-
340- return FALSE ;
341- }
342-
343322}
You can’t perform that action at this time.
0 commit comments