Jump to content

String could not be parsed as XML


grsims20

Recommended Posts

Hi Gang,


New forum user here...

I'm using a wordpress build which has broken and I'm getting an error log of "String could not be parsed as XML" on the twitter.php doc that comes with the theme. 

 

Here is the error log:

 

[23-Feb-2013 23:32:37] PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home2/gregosg8/public_html/wp-content/themes/iodineering/includes/class-twitter.php:86

Stack trace:

#0 /home2/gregosg8/public_html/wp-content/themes/iodineering/includes/class-twitter.php(86): SimpleXMLElement->__construct('')

#1 /home2/gregosg8/public_html/wp-content/themes/iodineering/includes/defaults.php(67): Padd_Twitter->__construct('grsims20', 3, true)

#2 /home2/gregosg8/public_html/wp-content/themes/iodineering/functions.php(30): require('/home2/gregosg8...')

#3 /home2/gregosg8/public_html/wp-settings.php(287): include('/home2/gregosg8...')

#4 /home2/gregosg8/public_html/wp-config.php(90): require_once('/home2/gregosg8...')

#5 /home2/gregosg8/public_html/wp-load.php(29): require_once('/home2/gregosg8...')

#6 /home2/gregosg8/public_html/wp-blog-header.php(12): require_once('/home2/gregosg8...')

#7 /home2/gregosg8/public_html/index.php(17): require('/home2/gregosg8...')

#8 {main}

    thrown in /home2/gregosg8/public_html/wp-content/themes/iodineering/includes/class-twitter.php on line 86

 

And here is the code section in question:

 

$xml = new SimpleXMLElement($data);

$this->followers_count = intval($xml->followers_count);
$this->friends_count = intval($xml->friends_count);
$this->listed_count = intval($xml->listed_count);
$this->statuses_count = intval($xml->statuses_count);
$this->profile_image_url = $xml->profile_image_url;

 

The "$xml = new SimpleXMLElement($data);" line is line 86 referenced in the error log. I don't care about having twitter embedded on my site, so disabling anything is fine, but I need help!

 

Thanks!

Greg

Link to comment
https://forums.phpfreaks.com/topic/275314-string-could-not-be-parsed-as-xml/
Share on other sites


$xml = simplexml_load_string($data);
$this->followers_count = intval($xml->followers_count);
$this->friends_count = intval($xml->friends_count);
$this->listed_count = intval($xml->listed_count);
$this->statuses_count = intval($xml->statuses_count);
$this->profile_image_url = $xml->profile_image_url;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.