I recently upgraded from php4/apache1.3 to php5/apache2.2. Now some topics on the forum don't display any more. In the errorlog is this error:
8: Undefined offset: 0
File: /home/xxx/public_html/joomla/components/com_smf/smf.class.php
Line: 455
or
8: Undefined offset: 0
File: /home/xxx/public_html/joomla/components/com_smf/smf.class.php
Line: 449
This is line 441-462 from smf.class.php. It has something to do with $matches[0] returning a empty value I think. Something similair as in this topic: http://www.joomlahacks.com/component/op ... pic,2503.0 Only there it is a notice, and on my site the forum disappears.
Code: Select all
if (empty($headers) || empty($keywords) || empty($css)) {
//if one is empty rebuild all
$headers = '';
$keywords = '';
$css = '';
$this->debug .= 'loading headers';
$regex = '/<head>.*<\/head>/smi';
preg_match($regex, $buffer, $matches);
$headers = $matches[0];
$regex = '/name="keywords" .*" \/>/i';
preg_match($regex, $headers, $matches);
$search = array ('/.*content="(.*)".*/i');
$replace = array ('$1');
$keywords = preg_replace($search, $replace, $matches[0]);
$regex = '/<link rel="stylesheet" .*" \/>/';
preg_match_all($regex, $headers, $matches);
foreach ($matches[0] as $key => $val) {
$css .= $val."\n";
}