phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Problem with use of parse_url function in php_seo_class

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite  » Advanced SEO URL
::  
Author Message
pvchat1



Joined: 15 Jul 2007
Posts: 13
Location: California

Problem with use of parse_url function in php_seo_classPosted: Fri Sep 07, 2007 1:10 am    Post subject: Problem with use of parse_url function in php_seo_class

I get this error on links to my site root.
Quote:
[phpBB Debug] PHP Notice: in file /phpbb_seo/phpbb_seo_class.php on line 215: Undefined index: path


Old versions of php return '' in path when there is no path. Newer versions (>4.7) leave path undefined.
Back to top
pvchat1



Joined: 15 Jul 2007
Posts: 13
Location: California

Problem with use of parse_url function in php_seo_classPosted: Fri Sep 07, 2007 1:50 am    Post subject: Re: Problem with use of parse_url function in php_seo_class

Here's a patch that fixes the error

After
Code:

      // Grabb params
      $parsed_url = parse_url($this->url);


Add
Code:

      if (!isset($parsed_url['path'])) {
         $parsed_url['path'] = '';
      }
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15135

Problem with use of parse_url function in php_seo_classPosted: Fri Sep 07, 2007 5:14 pm    Post subject: Re: Problem with use of parse_url function in php_seo_class

A dirtier but faster trick would be to replace :

Code:
      $this->file = basename($parsed_url['path']);


With :

Code:
      $this->file = basename(@$parsed_url['path']);


Since it's only a notice, and given where it's happening, we do not really care.


Thanks for reporting Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite  » Advanced SEO URL
Page 1 of 1

Navigation Similar Topics

Jump to: