There is a server where the phpinfo()
-function is disabled in the php.ini
. When I go to System -> System Information -> PHP Information there is an error message saying
Notice: Undefined offset: 0 in /joomlahome/administrator/components/com_admin/models/sysinfo.php on line 174
I would expect an error message pointing out that phpindo() is disabled.
The error message quoted.
PHP Version 5.3.27
Joomla! 3.3.6 Stable [ Ember ] 01-October-2014 02:00 GMT
Following the error message to joomlahome/administrator/components/com_admin/models/sysinfo.php
on line 174 I found that the case that there is no phpinfo returned in line 170 is not checked. So we go to line 174 without a valid string.
A fix would be to check the result of phpinfo (see also (http://php.net/manual/en/function.phpinfo.php)):
public function &getPHPInfo()
{
if (is_null($this->php_info))
{
ob_start();
date_default_timezone_set('UTC');
if (phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES))
{
$phpInfo = ob_get_contents();
ob_end_clean();
preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpInfo, $output);
$output = preg_replace('#<table[^>]*>#', '<table class="table table-striped adminlist">', $output[1][0]);
$output = preg_replace('#(\w),(\w)#', '\1, \2', $output);
$output = preg_replace('#<hr />#', '', $output);
$output = str_replace('<div class="center">', '', $output);
$output = preg_replace('#<tr class="h">(.*)<\/tr>#', '<thead><tr class="h">$1</tr></thead><tbody>', $output);
$output = str_replace('</table>', '</tbody></table>', $output);
$output = str_replace('</div>', '', $output);
$this->php_info = $output;
} else
{
// do we need another message here?
$this->php_info = '';
}
}
return $this->php_info;
}
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-02-24 12:35:07 |
Closed_By | ⇒ | brianteeman |
Please see #6148
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6042.