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

Started by michaelnl, January 01, 2008, 02:47:20 PM

Previous topic - Next topic

michaelnl

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 similar as in this topic: http://www.joomlahacks.com/component/option,com_smf/Itemid,94/topic,2503.0 [nofollow] Only there it is a notice, and on my site the forum disappears.

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


I did some 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 running joomla 1.1.13, SMF 1.1.4, JSMF 2.0.2.1 with php 5.2.5 en apache 2.2.6.

As you may have noticed I'm using the bridge from joomlahacks.com [nofollow], but they are no longer giving support and the forum is dead, so I hope that someone over here can help me! I haven't got any replies on joomla.org [nofollow] so far: http://forum.joomla.org/index.php/topic,247433.0.html [nofollow]

Orstio

QuoteAs you may have noticed I'm using the bridge from joomlahacks.com, but they are no longer giving support and the forum is dead, so I hope that someone over here can help me! I haven't got any replies on joomla.org so far: http://forum.joomla.org/index.php/topic,247433.0.html

Unfortunately, you'll find better support at joomlahacks.com for that integration than you will here.

anna.young

Michaelnl, You may also read this thread

http://www.simplemachines.org/community/index.php?topic=214301.0

and upgrade your joomla as you may have additional, more serious problems

Anna
Toronto German Shepherd Dog Rescue

"Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes... the ones who see things differently -- they're not fond of rules... You can quote them, disagree with them, glorify or vilify them, but the only thing you can't do is ignore them because they change things... they push the human race forward, and while some may see them as the crazy ones, we see genius, because the ones who are crazy enough to think that they can change the world, are the ones who do." (SJ)


anna.young

You're welcome Michaelnl,  unfortunately that bridge had quite a few issues... It is disappointing that it is not supported better...

Anna
Toronto German Shepherd Dog Rescue

"Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes... the ones who see things differently -- they're not fond of rules... You can quote them, disagree with them, glorify or vilify them, but the only thing you can't do is ignore them because they change things... they push the human race forward, and while some may see them as the crazy ones, we see genius, because the ones who are crazy enough to think that they can change the world, are the ones who do." (SJ)

Advertisement: