Home arrow Forum Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2008, 10:17:07 PM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Hacks
| |-+  Joomla-SMF Forum Support
| | |-+  Joomla-SMF 1.1.x (Moderators: -Wolverine, kai920)
| | | |-+  Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455  (Read 1228 times)
keltic
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 10


View Profile
Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455
« on: December 28, 2007, 06:24:01 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/option,com_smf/Itemid,94/topic,2503.0 Only there it is a notice, and on my site the forum disappears.

Code:
            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?
Logged
Javi
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


View Profile
Re: Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455
« Reply #1 on: March 07, 2008, 04:59:56 PM »

I have the same problem. Please, could someone help us??? Undecided Undecided Undecided
The problem cames with the server's upgrade to php version 5.2.5
« Last Edit: March 07, 2008, 05:04:15 PM by Javi » Logged
locutus
Joomla Expert
****

Karma: +26/-49
Offline Offline

Posts: 249


View Profile
Re: Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455
« Reply #2 on: March 17, 2008, 09:56:53 AM »

I am using PHP version 5.2.3 and I have no problems. So if PHP version is the problem you should stick to below that version. Some hosts allow the next rule in the .htaccess file to change your php version:

Code:
AddHandler application/x-httpd-php51 .php

This would set PHP to version 5.1.0. Please let me know if this helps.
Logged

Superdaantje
Joomla Guru
*****

Karma: +266/-23
Offline Offline

Posts: 370


Aka Livebox


View Profile WWW
Re: Hides forum: 8: Undefined offset: 0 smf.class.php line 449 & 455
« Reply #3 on: March 17, 2008, 04:03:56 PM »

There is more information about this.
http://www.atomicrocketturtle.com/Joomla/content/view/180/1/
http://www.joho.se/index.php?/archives/290-Problems-in-Joomla-after-upgrading-to-PHP-5.2.5.html

and the PHP 5.2.5 changelog here: http://www.php.net/ChangeLog-5.php

Quote
Fixed bug #41561 (Values set with php_admin_* in httpd.conf can be overwritten
with ini_set())

http://bugs.php.net/bug.php?id=41561

Quote
PHP 5.2.5 source code:
  zend_alter_ini_entry("session.name", sizeof("session.name"),
 Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER,
 PHP_INI_STAGE_RUNTIME);
Logged

My Projects
Joomlabridge.org JSMF 2.0.2.1 Bridge Support and Downloads
Dutchjoomla.org Dutch Joomla Community (more then 60.000 members)
D.Wagner Webservices
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
Search Contact About Advertise Blogs Topsites Submit News Register Login