Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Call to undefined method DOMElement::getLineNo #223

Closed
mazard opened this Issue · 3 comments

5 participants

@mazard



Fatal error: Call to undefined method DOMElement::getLineNo() in /var/www/vhosts/****/SimplePie.php on line 8652

I'm using the minified version in a php 5.2.6-1+lenny10.

Looking for a workaround I read in the php documentation that this function is only available since 5.3, although simplepie is supposed to support 5.2...

Anyway this function is buggy and shouldn't be used:
http://php.net/manual/en/domnode.getlineno.php
https://bugzilla.gnome.org/show_bug.cgi?id=676026

Edit:

As a fast workaround to keep my production site up, I changed in line 8653, this:

if ($this->base_location < $link->getLineNo())

by this:

$text = $link->ownerDocument->saveXML($link);
$line += substr_count($text, "\n");
if ($this->base_location < $line)

Regards!
mazard

@salamanders

I ran into the same thing, and instead copied the code from other places that getLineNo was being called.
Strange that some default to 0, others to 1.
(like line 11989: $line = method_exists($link, 'getLineNo') ? $link->getLineNo() : 1; )

Fatal error: Call to undefined method DOMElement::getLineNo() in /home/content/16/9503516/html/application/libraries/Simplepie.php on line 12030

@theclimber

I'm running into the same bug. I'm also using PHP-5.2 on lenny.

Thank you mazard for your workaroud. It seems to work now.

Regards

@rmccue rmccue closed this in 75baa96
@skyzyx skyzyx referenced this issue from a commit in skyzyx/simplepie
@rmccue rmccue Ensure $link->getLineNo() exists before using
Fixes #223
0d876f3
@Calystod Calystod referenced this issue in ldleman/Leed
Closed

Bug de mise à jour des flux #112

@pozh

Another place for the same error:
Fatal error: Call to undefined method DOMElement::getLineNo() in /library/SimplePie/Locator.php on line 280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.