?
avatar ymages
ymages
6 Sep 2015

in my server error_log I get many lines with :
PHP Fatal error: Call to a member function get() on a non-object in /components/com_users/models/login.php on line 62

the line 62 -> if ($return = $input->$method->get('return', '', 'BASE64'))

any idea of what could be wrong ?

thank you

System information (as much as possible)

Joomla 3.4.3
PHP 5.5.28
Apache 2.4.16
MySQL 5.5.42-cll

Additional comments

it should be ?

if (!empty($method) && isset($input->$method) && is_object($input->$method) && $return = $input->$method->get('return', '', 'BASE64')

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar ymages ymages - open - 6 Sep 2015
avatar mbabker
mbabker - comment - 6 Sep 2015

$method is set a few lines before that and should always have a value (see https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/input/input.php#L334), the extra checks should be absolutely unnecessary. It seems traffic is hitting your site with invalid HTTP requests as $_SERVER['REQUEST_METHOD'] is a pretty standard value to be set when running PHP applications via web request.

avatar ymages
ymages - comment - 6 Sep 2015

Thanks a lot for your fast reply

And from my side there is nothing to do, I’ve got hundreds of error lines

Le 6 sept. 2015 à 02:35, Michael Babker notifications@github.com a écrit :

$method is set a few lines before that and should always have a value (see https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/input/input.php#L334 https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/input/input.php#L334), the extra checks should be absolutely unnecessary. It seems traffic is hitting your site with invalid HTTP requests as $_SERVER['REQUEST_METHOD'] is a pretty standard value to be set when running PHP applications via web request.


Reply to this email directly or view it on GitHub #7826 (comment).

avatar zero-24 zero-24 - change - 6 Sep 2015
Category Libraries
avatar zero-24 zero-24 - change - 6 Sep 2015
Priority Urgent Medium
avatar laoneo
laoneo - comment - 5 Oct 2015

Please provide some testing instructions that we can try to reproduce the issue.

avatar ameiri
ameiri - comment - 24 Nov 2015

On my system this happens due to some clients accessing the website using the HEAD method. This is valid HTTP, as far as I understand things, however there is no php superglobal for HEAD (as opposed to GET and POST).
JINPUT has a __get() magic method to get input objects. When $method == 'GET', $input->$method results in said superglobal being accessed. However when $method == 'HEAD' this fails. The following final line from the method (file libraries/joomla/input/input.php) shows that something is missing:

// TODO throw an exception

I am new to php and to Joomla, but I fail to see the reason for accessing request inputs in this manner. It seems to me that in components/com_users/models/login.php the line:

if ($return = $input->$method->get('return', '', 'BASE64')

could (should?) be replaced with:

if ($return = $input->get('return', '', 'BASE64'))


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7826.

avatar brianteeman
brianteeman - comment - 8 May 2016

Hi you created this issue sometime ago but no code has been provided for people to evaluate. As no one has shown any interest in providing a pull request I am closing this at this time. If code is provided (a pull request) it can always be re-examined.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7826.

avatar brianteeman brianteeman - change - 8 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 17:17:21
Closed_By brianteeman
avatar brianteeman brianteeman - close - 8 May 2016
avatar YaegerDesign
YaegerDesign - comment - 26 Jan 2017

I have gotten this same error a few times recently:
PHP Fatal error: Call to a member function get() on a non-object in /path/to/site/components/com_users/models/login.php on line 62

However, it seems to have just started in 2017.

Add a Comment

Login with GitHub to post a comment