| 1 |
<?php // -*-php-*- |
<?php // -*-php-*- |
| 2 |
/* $Id: fa_simplexml.module,v 1.1.2.8 2007/11/22 15:11:49 alaa Exp $ */ |
/* $Id: fa_simplexml.module,v 1.1.2.9 2007/11/23 23:07:16 alaa Exp $ */ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_fooaggregatorapi() |
* Implementation of hook_fooaggregatorapi() |
| 43 |
// We got a malformed XML |
// We got a malformed XML |
| 44 |
if ($parsed_xml === FALSE || $parsed_xml == NULL) { |
if ($parsed_xml === FALSE || $parsed_xml == NULL) { |
| 45 |
$error = libxml_get_last_error(); |
$error = libxml_get_last_error(); |
| 46 |
if (function_exists('iconv') && $error->code == 9) { |
|
| 47 |
|
//unicode errors are the most common cause of failed parsing |
| 48 |
|
if (function_exists('iconv')) { |
| 49 |
$xml = iconv("UTF-8", "UTF-8//IGNORE", $xml); |
$xml = iconv("UTF-8", "UTF-8//IGNORE", $xml); |
| 50 |
_fa_simplexml_refresh($feed, $xml); |
_fa_simplexml_refresh($feed, $xml); |
| 51 |
$xml = null; |
$xml = null; |