Joomla PHP error in page content

Warning. Parameter 3 for showBlogSection () must be a link, the value is specified in / home / smartsta / public _html / includes / Cache / Lite / Function.php on line 100

I get the above error in my content areas on my Joomla site all of a sudden, any suggestions?

Update: Cannot find access to a specific file and directory in the file directory godaddy ftp, ftp or Joomal C-panel. Within FTP, I cannot find access to this particular file to find out what is on line 100. In the Joomla panel in Global Configurations, I was able to disable the error message "none" because this error is not hidden. Inside the cache directory, I do not see any parameters for accessing the folder, although it is displayed. I also see this at the bottom of the c-panel screen, but just links to the joomla help site, and within the fields I do not see the described area for switching "ON" or "OFF", "The following PHP Server settings are not optimal for security, and they recommended change: Setting PHP register_globals ON instead of OFF "

Update2:

I found the file in question, below is the code. Line 100 defines only:

global $$ object_123456789;

application / x-httpd-php Function.php PHP script text

 <?php /** * This class extends Cache_Lite and can be used to cache the result and output of functions/methods * * This class is completly inspired from Sebastian Bergmann's * PEAR/Cache_Function class. This is only an adaptation to * Cache_Lite * * There are some examples in the 'docs/examples' file * Technical choices are described in the 'docs/technical' file * * @package Cache_Lite * @version $Id: Function.php 47 2005-09-15 02:55:27Z rhuk $ * @author Sebastian BERGMANN < sb@sebastian-bergmann.de > * @author Fabien MARTY < fab@php.net > */ // no direct access defined( '_VALID_MOS' ) or die( 'Restricted access' ); require_once( $mosConfig_absolute_path . '/includes/Cache/Lite.php' ); class Cache_Lite_Function extends Cache_Lite { // --- Private properties --- /** * Default cache group for function caching * * @var string $_defaultGroup */ var $_defaultGroup = 'Cache_Lite_Function'; // --- Public methods ---- /** * Constructor * * $options is an assoc. To have a look at availables options, * see the constructor of the Cache_Lite class in 'Cache_Lite.php' * * Comparing to Cache_Lite constructor, there is another option : * $options = array( * (...) see Cache_Lite constructor * 'defaultGroup' => default cache group for function caching (string) * ); * * @param array $options options * @access public */ function Cache_Lite_Function($options = array(NULL)) { if (isset($options['defaultGroup'])) { $this->_defaultGroup = $options['defaultGroup']; } $this->Cache_Lite($options); } /** * Calls a cacheable function or method (or not if there is already a cache for it) * * Arguments of this method are read with func_get_args. So it doesn't appear * in the function definition. Synopsis : * call('functionName', $arg1, $arg2, ...) * (arg1, arg2... are arguments of 'functionName') * * @return mixed result of the function/method * @access public */ function call() { $arguments = func_get_args(); $id = serialize($arguments); // Generate a cache id if (!$this->_fileNameProtection) { $id = md5($id); // if fileNameProtection is set to false, then the id has to be hashed // because it a very bad file name in most cases } $data = $this->get($id, $this->_defaultGroup); if ($data !== false) { $array = unserialize($data); $output = $array['output']; $result = $array['result']; } else { ob_start(); ob_implicit_flush(false); $target = array_shift($arguments); if (strstr($target, '::')) { // classname::staticMethod list($class, $method) = explode('::', $target); $result = call_user_func_array(array($class, $method), $arguments); } else if (strstr($target, '->')) { // object->method // use a stupid name ($objet_123456789 because) of problems when the object // name is the same as this var name list($object_123456789, $method) = explode('->', $target); global $$object_123456789; $result = call_user_func_array(array($$object_123456789, $method), $arguments); } else { // function $result = call_user_func_array($target, $arguments); } $output = ob_get_contents(); ob_end_clean(); $array['output'] = $output; $array['result'] = $result; $this->save(serialize($array), $id, $this->_defaultGroup); } echo($output); return $result; } } ?> 
+4
source share
1 answer

This is not quite a mistake. This is a warning .

all of a sudden? You may have updated / updated your version of PHP. Or changed the configuration of PHP to "strict mode".

The message " , which is expected to be a link, value ), means that the called function should receive the link , not the value . See:

 $something = 9; show_section($something); // here you are passing a variable // this will be accepted as a reference show_section(9); // here you are NOT passing a reference // here you are passing a VALUE 

When you pass "by reference", the function can change the value of the variable ... in the above example:

 function show_section(&$parameter) { $parameter = 'changed!'; } 
  • Pay attention to the ampersand symbol & before $parameter - this is how we specify the function, a link is required.

  • AFTER the function call, in the above example, the value of the $something variable will be changed! .


The error throwing line is NOT "global." This is the following:

 $result = call_user_func_array(array($$object_123456789, $method), $arguments); 

The problem here is that the function is called indirectly using the call_user_func_array function.

The solution will convert all arguments to links. Sentence:

 foreach ($arguments as $count => $value) { $param = 'param' . $count; $$param = $value; $arguments[$count] = &$$param; } 

Put the code above at the beginning of the call function, on the right after the following line:

 $id = serialize($arguments); 

Give it a try!

+7
source

Source: https://habr.com/ru/post/1400849/


All Articles