-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to a member function get_uri() on a non-object in simplepie/library/SimplePie/Misc.php on line 83 #214
Comments
yeah, im getting those error too |
Same here... |
Yeah, too bad no one is answering here. :( |
When I enter this URL: http://bfgb.wordpress.com/feed/ What's the problem?! |
I just got this error using a fresh git checkout on an Ubuntu box.
Perhaps change Misc.php since
However, making that change results in:
|
Thanks for reporting this issue! In future @hakimihamdan88, it's not necessary to CC me as I get notified of all issues automatically. I would have responded sooner, but it has been a busy week. :) I'll take a look into this. @gsnedders, want to check this when you check #219? This also seems like somewhere we need unit tests too. For those reporting this issue: can you |
public static function absolutize_url($relative, $base) That is where the error happens. When I try to var dump $relative and $base using this feed: http://bfgb.wordpress.com/feed/, var_dump($base) The error happens when this code is being run return $iri->get_uri(); Your help would be greatly appreciated since we are already using your library in our live site. Thanks! |
Is there any workaround ? I am getting this error on $item->get_content() as well: get_items() as $item): ?> get_permalink(); ?> get_title(); ?>Posted on get_date('j F Y | g:i a'); ?> get_content(); ?> |
Same problem here. base:http://www.mnac.cat/?lan=002 It looks like there is a problem in the url validation, I think in my case the problem is the '@'. As a fast workaround I replaced the is_valid function to return always true.
It seems to work fine, I don't know if it can cause any other problems but its not breaking my production site at least. Regards! |
@mazard Is that the function in the IRI.php?
|
Hi Also having the same problem and wanted to provide some debug text. SimplePie died on this specific entry from engadget
I think it chokes on that %21 at the end of the "embed youtube" link Hope this helps! |
is there an ETA on a fix for this? My customer is getting very anxious... |
I'm having the same problem with the feed --- http://rss.cbc.ca/lineup/topstories.xml Note: The error is preventing my page from fully rendering. Any suggestions on how I force the page to load fully despite this (or any future) errors? |
Hi, I think this problem is being caused if the URL contains numbers for some reason. My code works with other feeds that have no numbers but not with http://rss.cnn.com/rss/edition_business360.rss With this feed I get the error quoted above. |
@cookiejest But I'm getting the error when using this URL: http://bfgb.wordpress.com/feed/ that doesn't have a number. |
@jimgym1989 yours has a space in one of the URLs I think |
@cookiejest What URL? I'm not seeing that one that has a space. Hmmm... |
@jimgym1989 string(31) "http://bfgb.wordpress.com/feed/"Blogging for a Good Book But I don't really know |
@cookiejest Did you try that in your end? Did it also get the same error? |
@cookiejest The weird thing is that when we try to add those URLs on their simplepie demo (http://simplepie.org/demo/), it's not giving us error, is this a server issue? like our server messes everything. But the error doesn't look like a server error or issue. I wonder when those simplepie developers will fixed this problem. |
@jimgym1989 http://bfgb.wordpress.com/feed/ doesnt work on my set up either as it gives me the error. This is a problem with SimplePie code. |
@cookiejest Try putting that URL in http://simplepie.org/demo/, it's not giving that error. |
@jimgym1989 I see that it works using that, will have to wait for them to try and fix it as I don't understand SimplePie well enough to suggest a way to solve it without causing other problems |
I don't if it can help to debug. This feed create the issue in my case: http://lucatrevisan.wordpress.com/feed/ |
its seems @rmccue is busy guys |
We're doomed! :( |
I added a ? to the function call replace_invalid_with_pct_encoding. I was passing a query string to break cache on the website where I pull the RSS feed. I think it would also work if you added a % which is the invalid character. line 1062 @ IRI.php else
{
$valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/');
$removed = $this->remove_dot_segments($valid);
$cache[$ipath] = array($valid, $removed);
$this->ipath = ($this->scheme !== null) ? $removed : $valid;
} This is just a workaround and not any sort of fix. There seems to be something not being handled by replace_invalid_with_pct_encoding and thus it isn't normalizing the URL completely. |
I get this problem too when using SimplePie_FIle with a path that has dots in it. e.g. DIR . '/../fixtures/test-data.xml'; This is caused by line 1065 @ IRI.php $removed = $this->remove_dot_segments($valid); |
@Hunin : I wonder what's wrong with this URL: http://bfgb.wordpress.com/feed/ It's giving me those error. It seemed like there's no malicious characters on that URL. Have you tried entering your URL on their demo site? Looks like their demo site won't show any errors and works perfectly |
@jimgym1989 It looks like SimplePie processes every URL in the feed using set_path function. In your feed, you have some URLs with a ? character like <atom:link rel='hub' href='http://bfgb.wordpress.com/?pushpress=hub'/> on line 29 and <media:content url="http://bfgb.files.wordpress.com/2012/07/europe.jpeg?w=200" medium="image"> on line 63. So I believe adding a ? character to the extra characters of the function replace_invalid_with_pct_encoding will bypass these characters. |
@Hunin I added a ? on that call $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/?'); but still it gives me error |
I have the same problem. Temporarily solved it by returning true in the is_valid() function! But will watch for a solution! |
@iSenne: temporarily solved in what sense? I did the same, but I still get the Fatal Error :( |
This is a strange issue. I have been parsing the same feeds for weeks without any problems and now I am getting this error on many of my feeds. Is anyone working on this? Seems like the Simplepie guys may have abandoned it |
@cmmartin I'm definitely watching this issue, but I've not yet had time to track it down. If anyone can take one of these broken feeds and break it down to just the part causing the error, that would help immensely. |
@rmccue That's the problem, I personally don't know the reason why this feed http://bfgb.wordpress.com/feed/ broke up, @Hunin told me that that's because I have some URLs with a ? character like on line 29 and on line 63. Kindly work on this one please, we are already moving our site in live so that's why we needed to find a solution for this one. I know you're kinda busy on your job, but please, kindly make time for this one. Have mercy! Thanks @rmccue! Your help would be greatly appreciated! :) |
To stop the error from appearing I just added a check to see if the object was created and pass the result of the method if it is and false if not so the absolutize_url method in Misc.php became:
This seems to be working for me now |
@iSenne: are you talking about the function is_valid() in IRI.php? Nothing changes here if I change the false into true. |
Some var_dump that can help debugging. For many feeds, the error arises when the values passed to absolutize_url are: There are other cases too. For example, for the feed http://projectprime.org/projectprime/feed.php the var_dump on $relative and $base before the absolutize_url gives, respectively: string(46) "http://projectprime.org//data/comic/en/301.png" Maybe in this case the double slash is what creates issues? |
@demoncheese : wow that one worked for me, but I got a feeling that that's just a temporary fix, I hope @rmccue or the simplePie guys would do some unit testing. Thanks! |
Please, see the pull request I just issued. This is the fix I use: #228 |
any updates? |
Looks like I have a test case: when the path component begins with "//" |
Also closes #228, but doesn't fix the base problem where paths starting with // aren't parsed by SimplePie_IRI.
Also closes #228, but doesn't fix the base problem where paths starting with // aren't parsed by SimplePie_IRI.
Hi there,
I'm using your very wonderful code but I noticed that I run into this problem:
Call to a member function get_uri() on a non-object in simplepie/library/SimplePie/Misc.php on line 83
I really don't have an idea why this is happening.
Kindly guide me how to fix this one.
Thanks!
The text was updated successfully, but these errors were encountered: