Strict Standards

xdaniel
Posts: 22
Joined: 2012-07-10 21:21

Strict Standards

Post by xdaniel » 2012-09-22 07:46

Hi Fred,

MX Search worked very fine on 5.3. From now to than it doesn't work anymore and I got the following error:
Strict Standards: Only variables should be passed by reference in /is/htdocs/.../includes/MXSearch/KT_MXSearchConfig.class.php on line 122

-> PHP 5.3.16

Any idea?

Best wishes

Daniel

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Strict Standards

Post by Fred » 2012-09-22 10:47

Check your mod_sec rules and see if the search page triggers it somewhere.

I have php 5.3.16 on my servers and it works fine.

If there is a mod_sec report for the page calling the search script make sure to tell your host not to whitelist the domain for the rule, only whitelist the script.

xdaniel
Posts: 22
Joined: 2012-07-10 21:21

Re: Strict Standards

Post by xdaniel » 2012-09-23 10:07

Hi Fred,

I don't really know what I should do, but I disabled all PHP warning with .htaccess and now it works again. Thanks.

Best wishes

Daniel

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Strict Standards

Post by Fred » 2012-09-23 15:36

Hi Daniel,
Ask your host to check the error logs and see if they can shed some more light on this.
You can also check in the folder from where the script is run, you might find an error log in there that can give you more info.

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Strict Standards

Post by Fred » 2012-09-23 16:20

ok got it I don't have strict error reporting so I missed that one.

In php 5.xx you are not allowed to change the return value of a function.
Basically you can't say foo() returned 'ABC' but I want to make it return 'XYZ'
However if you say $protocol = foo() you can do whatever you want with $protocol.

Change KT_MXSearchConfig.class.php line 122 as follows

Original Line 122

Code: Select all

$protocol = strtolower(array_shift(explode('/', $_SERVER['SERVER_PROTOCOL'])));
Changed Line 122

Code: Select all

$protocol = explode('/', $_SERVER['SERVER_PROTOCOL']);
$protocol = strtolower(array_shift($protocol));

xdaniel
Posts: 22
Joined: 2012-07-10 21:21

Re: Strict Standards

Post by xdaniel » 2012-09-23 16:29

yes, no more errors. Thank you!

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Strict Standards

Post by Fred » 2012-09-23 16:47

Great Daniel,
Do us a favour and set your error reporting back to what it was and report any other errors you might come across.

For those that want to patch, you can download the updated MX Search file here.
http://www.interaktonline.info/files/56 ... earch.html

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Strict Standards

Post by Fred » 2012-09-28 15:53

Daniel,
You might want to change the

Code: Select all

$HTTP_GET_VARS['XX']
into

Code: Select all

$_GET['XX']
while you at it.
That is the generated code in your actual search page.

xdaniel
Posts: 22
Joined: 2012-07-10 21:21

Re: Strict Standards

Post by xdaniel » 2012-10-02 06:26

Hi Fred,

yes I did tha too and works fine. There were two statements in my page.

Daniel

Post Reply