Page 1 of 1

Strict Standards

Posted: 2012-09-22 07:46
by xdaniel
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

Re: Strict Standards

Posted: 2012-09-22 10:47
by Fred
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.

Re: Strict Standards

Posted: 2012-09-23 10:07
by xdaniel
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

Re: Strict Standards

Posted: 2012-09-23 15:36
by Fred
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.

Re: Strict Standards

Posted: 2012-09-23 16:20
by Fred
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));

Re: Strict Standards

Posted: 2012-09-23 16:29
by xdaniel
yes, no more errors. Thank you!

Re: Strict Standards

Posted: 2012-09-23 16:47
by Fred
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

Re: Strict Standards

Posted: 2012-09-28 15:53
by Fred
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.

Re: Strict Standards

Posted: 2012-10-02 06:26
by xdaniel
Hi Fred,

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

Daniel