Closed (fixed)
Project:
Leech
Version:
5.x-1.x-dev
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Jun 2007 at 03:45 UTC
Updated:
20 Aug 2007 at 14:34 UTC
Jump to comment: Most recent file
We've isolated an issue with our installation of Drupal and version 5.x-1.7 of this module. When creating a feed which contains this code: , Leech doesn't read the feed. However with this tag removed from the feed Leech works correctly. We don't have this issue with the previous version of Leech on a different installation of Drupal. An example of a failing feed can be found here: http://www.aph.gov.au/library/rssbd_feed.xml.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | leech_news_parser_php5.patch | 1.04 KB | alex_b |
Comments
Comment #1
f1shnch1ps commentedJust to reiterate, the suspect code in an RSS feed which renders Leech inoperable as regards to that feed is
<guid isPermaLink="true">Comment #2
cburschkaI'm not involved with Leech and don't know what might be the problem, but could you be more specific?
<guid isPermaLink="true">, by itself, is not well-formed XML. Do you mean the full guid entity, which is<guid isPermaLink="true">[permanent link to the item]</guid>, that is, is the tag closed and containing an identifier? If it isn't, the tag mentioned above would break the XML format and probably throw off the parser.Could you try setting isPermaLink to "false" instead of "true"? Perhaps the parser can't handle permanent links correctly. Or if the identifier between the guid tags is not a URL but some other string, isPermaLink should be "false" anyway...
I hope that if these don't solve the problem, it will make it easier for the Leech maintainers to narrow down the cause.
Comment #3
cburschkaOkay never mind, from the linked page it looks like the guid tag is closed and well-formed, taking as an example:
<guid isPermaLink="true">http://www.aph.gov.au/library/pubs/bd/2006-07/07bd166.pdf</guid>So I have nothing more to contribute.
Comment #4
f1shnch1ps commentedWe could not resolve this issue with our MySQL 5/PHP 5 installation so we reverted to MySQL 4 and PHP 4 which fixed the issue. Go figure.
Comment #5
alex_b commentedInteresting that reverting to php4/mysql4 did the job. Could you explain where exactly leech failed to "read" the feed - when you create the feed right away?
Comment #6
keesje commentedHi,
I seem to have exactly the same problem, yes, this occurs right after creating the feed.
In my case both the elements link and squid are provided, like
for example, token from this feed:
http://rss.vrtnieuws.net/cm/vrtnieuws.net/nieuws/hoofdpunten
I realy look forward to a solution. I found several feeds not working, to me because of this issue.
Comment #7
keesje commentedHi,
I seem to have exactly the same problem, yes, this occurs right after creating the feed.
In my case both the elements link and guid are provided, like
for example, token from this feed:
http://rss.vrtnieuws.net/cm/vrtnieuws.net/nieuws/hoofdpunten
I realy look forward to a solution. I found several feeds not working, to me because of this issue.
Comment #8
keesje commentedPleez remove double post, sorry for that.
I nailed down the couse of the error, its in the pubDate element.
This works fine:
Wed, 27 Jun 2007 11:09:59 GMTThis one not:
wo, 27 jun 2007 08:22:00 +0200Comment #9
keesje commentedMore details,
I'm using 1,8 version
Line 283 leech_news_parser.inc:
" $item->date = strtotime($data[$feed->has_dates][0]['VALUE']); // strtotime() returns -1 on failure"
does NOT return -1, it returns an empty string! This might be a lead to the previous post, regarding PHP versions.
My (probaby to quick) conclusion:
PHP's strtotime funcion does not parse none-english date/time strings like this one. If it fails (at least in this occasion), it does not return a -1 value.
My hack for temporary solution:
Replace line 291-293 in leech_news_parser.inc with:
I'm on:
Apache version :
Apache/2.0.55 (Win32)
PHP version :
5.1.2
Loaded extensions :
bcmath, calendar, com_dotnet, ctype, date, ftp, iconv, odbc, pcre, Reflection, session, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, apache2handler, mbstring, curl, gd, ldap, mysql, mysqli, PDO, pdo_sqlite, SQLite
MySQL version :
5.0.18-nt
Comment #10
alex_b commentedkeesje76, great bug reporting, thank you very much.
I just read up that strtotime, as of PHP5.1.0, returns FALSE when the time string is not valid. Before it was -1. This makes sense, because a unix timestamp could also be negative, and therefore have the value -1. http://se.php.net/strtotime
In the attached patch, I added a version check to the parsing process - can you apply the patch and test it on your PHP 5 environment?
Comment #11
alex_b commentedAny news?
Comment #12
keesje commentedShit, I missed your reaction in my tracker!! (Are Issue reactions tracked at all ??)
I see 1.9 is released in the meantime...
I gonna test the pach on 1.8 still.
Comment #13
keesje commentedPatch works on situation as described in above post, thanks.
I'm looking into another issue now..., this one seemes solved fine.
Comment #14
keesje commentedPatch works in situation as described in above post, thanks.
I'm looking into another issue now..., this one seemes solved fine.
Comment #15
alex_b commented1.8/1.9 doesn't make a difference here. How are your tests going? I will commit the patch as soon as you give me green light.
Comment #16
keesje commentedI copy/pasted the updated code from patched 1.8 to 1.9, seems to work fine in my testbed. Later this month it's going to be tested more heavily in production use. So, fixed to me, thanks again.
Comment #17
alex_b commentedThis is committed to 5.x dev. Thank you guys for going to the ground of this one. http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/leech/leech...
Comment #18
(not verified) commented