Forum Moderators: coopster

Message Too Old, No Replies

Strict Standards & Fatal error

         

dougmcc1

5:01 am on Aug 11, 2015 (gmt 0)

10+ Year Member



Does anyone know what might cause the following errors or how to fix them?

Strict Standards: Non-static method rlDebug::errorHandler() should not be called statically in /home/xyz/public_html/includes/classes/rlNavigator.class.php on line 117

Fatal error: Call-time pass-by-reference has been removed in /home/xyz/public_html/includes/controllers/common.inc.php on line 42

whitespace

7:30 am on Aug 11, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



Strict Standards: Non-static method rlDebug::errorHandler() should not be called statically


You have a non-static method, such as:


public function errorHandler() {
/* Rest of code here */
}


And it is being called statically, ie. on the class itself (with the scope resolution operator / double colon), rather than an object instance (which the compiler is expecting).

In order to call a method statically, the method must be explicitly declared static at compile time... using the static keyword:


public static function errorHandler() {
/* Rest of code here */
}


Fatal error: Call-time pass-by-reference has been removed...


This occurs when you try to pass a reference (ie. &$myVar as opposed to $myVar) in the function call, rather than declaring in the function signature that the parameter is a reference.

For example:

function myFunction($myParam) {
/* Rest of code here */
}
myFunction(&$myArg); // Call time pass-by-reference


Instead, you should declare in the function signature itself that the parameter is expected to be a reference:

For example:

// Declare that $myParam is a reference (& prefix)
function myFunction(&$myParam) {
/* Rest of code here */
}
myFunction($myArg); // No reference here, but a reference is passed.

dougmcc1

11:43 am on Aug 11, 2015 (gmt 0)

10+ Year Member



The file mentioned in the first error, rlNavigator.php, just has a bunch of characters after the first few lines of code.

Here are the first few lines of code:
<?php //003ac
if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');@dl($__ln);if(function_exists('_il_exec')){return _il_exec();}$__ln='/ioncube/'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}@dl($__ln);}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return _il_exec();}echo('Site error: the file <b>'.__FILE__.'</b> requires the ionCube PHP Loader '.basename($__ln).' to be installed by the site administrator.');exit(199);

?>
The rest of it looks like this:
4+oV5BiMsgGDoJwBtDLFX+DhgEQHy+LYOzEI9l4Gyq96c9MPBkKeJTtTGqQI29wRx4zf0cKEUTw+
ZEC8P/rlmxt7q9jpYmYV+siP+K3D2nDMhswOvvOUQvb+QdS80FtP4zP4cDKOkZuMbHDQLAtWg3IK
/RiYetZbPjQPn7UJuZXfqB2vJLE4N763KT2iTvrc2NC6TjoixWZmCB/Z2xE9+tvAmtG3MXT/4XF1..............etc

So I'm not sure what to change. Any ideas?

dougmcc1

11:51 am on Aug 11, 2015 (gmt 0)

10+ Year Member



I'm also getting this error:
Strict Standards: Non-static method rlDebug::errorHandler() should not be called statically in /home/cityloca/public_html/includes/classes/rlHook.class.php on line 67

The line of code on line 67 is this:
if (!$hooks[$tmp_hooks[$key]['Name']])

I dont see any &? symbols being used next to each other anywhere in the code for the rlHook.class.php file.

whitespace

12:51 pm on Aug 11, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



Unfortunately it seems rlNavigator.php is protected by ionCube. This is a tool that some developers will use to encrypt/obfuscate their code in order to prevent it being modified/copied by a third party. You'll probably need to contact the original developer.

I'm also getting this error:
Strict Standards: Non-static method rlDebug::errorHandler() should not be called statically
:
I dont see any &? symbols


The "&" symbol is related the other error you were getting (call time pass-by-reference).

Print the lines surrounding line#67.

dougmcc1

3:05 am on Aug 12, 2015 (gmt 0)

10+ Year Member



Thanks for the continued help. Here are the lines of code around line 67:

function getHooks()
{
$this -> setTable('hooks');
$tmp_hooks = $this -> fetch( array('Name', 'Code'), array('Status' => 'active') );
$this -> resetTable();

foreach ($tmp_hooks as $key => $value)
{
if (!$hooks[$tmp_hooks[$key]['Name']])
{
$hooks[$tmp_hooks[$key]['Name']] = $tmp_hooks[$key]['Code'];
}
else
{
$tmp_hook = $hooks[$tmp_hooks[$key]['Name']];

unset($hooks[$tmp_hooks[$key]['Name']]);


if (is_array($tmp_hook))
{
$tmp_hook[] = $tmp_hooks[$key]['Code'];
$hooks[$tmp_hooks[$key]['Name']] = $tmp_hook;
}
else
{
$hooks[$tmp_hooks[$key]['Name']][] = $tmp_hooks[$key]['Code'];
$hooks[$tmp_hooks[$key]['Name']][] = $tmp_hook;
}
}
}

$this -> rlHooks = $hooks;
$GLOBALS['hooks'] = $hooks;
}

whitespace

3:02 pm on Aug 14, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



Well, there is no such error in that block of code. It may be possible that some other error in that code is triggering the custom error handler (rlDebug::errorHandler() looks like it could be your error handler?) and your error handler itself is triggering this E_STRICT message!?

One thing that does look strange about line#67 is that the variable $hooks does not appear to be defined in that function?! This could be triggering an E_NOTICE ("Undefined variable: hooks in ....")?