fixed: Syndicated Content doesn't decode alternate character sets
This commit is contained in:
parent
ceb082ea1a
commit
3d5224c93c
2 changed files with 8 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
7.6.0
|
7.6.0
|
||||||
|
- fixed: Syndicated Content doesn't decode alternate character sets
|
||||||
- fixed: Some templates ship with isPublic=1
|
- fixed: Some templates ship with isPublic=1
|
||||||
- fixed: DataForm export tab delimited doesn't work
|
- fixed: DataForm export tab delimited doesn't work
|
||||||
- fixed: Project Manager sometimes causes errors when adding users to a task
|
- fixed: Project Manager sometimes causes errors when adding users to a task
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,12 @@ sub _get_rss_data {
|
||||||
$cache->set({'error' => 1, 'error_status' => $response->status_line}, 3600);
|
$cache->set({'error' => 1, 'error_status' => $response->status_line}, 3600);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
my $xml = $response->decoded_content;
|
my $xmlEncoding;
|
||||||
|
if ($response->content =~ /<\?xml.*?encoding=['"](\S+)['"]/i) {
|
||||||
|
$xmlEncoding = $1;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $xml = $response->decoded_content($xmlEncoding ? (charset => $xmlEncoding) : ());
|
||||||
|
|
||||||
# Approximate with current time if we don't have a Last-Modified
|
# Approximate with current time if we don't have a Last-Modified
|
||||||
# header coming from the RSS source.
|
# header coming from the RSS source.
|
||||||
|
|
@ -353,16 +358,7 @@ sub _get_rss_data {
|
||||||
my $last_modified = defined($http_lm)? $http_lm : time;
|
my $last_modified = defined($http_lm)? $http_lm : time;
|
||||||
|
|
||||||
# XML::RSSLite does not handle <![CDATA[ ]]> so:
|
# XML::RSSLite does not handle <![CDATA[ ]]> so:
|
||||||
$xml =~ s/<!\[CDATA\[(.*?)\]\]>/$1/sg;
|
$xml =~ s/<!\[CDATA\[(.*?)\]\]>/HTML::Entities::encode_entities($1)/esg;
|
||||||
|
|
||||||
# Convert encoding if needed
|
|
||||||
$xml =~ /<\?xml.*?encoding=['"](\S+)['"]/i;
|
|
||||||
my $xmlEncoding = $1 || 'utf8';
|
|
||||||
|
|
||||||
if (Encode::is_utf8($xml)) {
|
|
||||||
} else {
|
|
||||||
$xml = Encode::decode($xmlEncoding, $xml);
|
|
||||||
}
|
|
||||||
|
|
||||||
my $rss_lite = {};
|
my $rss_lite = {};
|
||||||
eval {
|
eval {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue