Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455

Discuss the integration of SMF here.
keltic
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Dec 28, 2007 11:24 pm

Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455

Postby keltic » Fri Dec 28, 2007 11:27 pm

Hi,

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";
                }


Could someone please help?

keltic
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Dec 28, 2007 11:24 pm

Re: Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455

Postby keltic » Sun Dec 30, 2007 5:52 pm

Nobody has a idea what is causing this? I did some more research, and I found only 1 other person with the same problem. It was caused by an corrupted table. All my tables are fine according to MySQL. I also noticed that these forumtopics are only not readable by moderators and higher, and some members. When I log out, or log in to a normal user account the topic displays just fine.

I'm runing joomla 1.1.13, SMF 1.1.4, JSMF 2.0.2.1 with php 5.2.5 en apache 2.2.6.

If anyone could help me with this, it would be really appreciated!

User avatar
vdrover
Joomla! Guru
Joomla! Guru
Posts: 616
Joined: Fri Mar 03, 2006 3:26 pm
Location: Canuck via MKE
Contact:

Re: Hides forum: 8: Undefined offset: 0 smf.class.php line 449 &

Postby vdrover » Mon Mar 03, 2008 7:02 pm

Repairing some corrupt tables in the DB solved this for me. There are some other fixes discussed on joomlahacks.com.
Victor Drover
http://anything-digital.com - Joomla Extensions and Custom Development
https://watchful.li - Remote backup, update and security monitoring for Joomla.


Return to “SMF - Simplemachines.org Forum”

Who is online

Users browsing this forum: No registered users and 6 guests