View Single Post
  #60  
Old 05-16-2006, 09:35 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

Phil, you're correct, it's matching more than it should.

Try this:

Open include/class.xcart_seo.php

FIND
Code:
function replaceUrl($uri){ global $xcart_web_dir; $replacement = $uri; extract(parse_url($replacement)); if($scheme!='ftp' && $scheme!='mailto' && $scheme!='javascript'){ if($query && preg_match('@home\.php$@i',$path)){ $gen_url = preg_replace_callback('@(.*)[&]*cat=([0-9]+)[&]*(.*)@i', array( &$this,'replaceCategoryUrl'),$query); } elseif($query && preg_match('@product\.php$@i',$path)){ $gen_url = preg_replace_callback('@(.*)[&]*productid=([0-9]+)[&]*(.*)@i', array( &$this,'replaceProductUrl'),$query); } elseif($query && preg_match('@image\.php$@i',$path)){ $gen_url = preg_replace_callback('@(.*)[&]*productid=([0-9]+)[&]*(.*)@i', array( &$this,'replaceImageUrl'),$query); }

REPLACE WITH
Code:
function replaceUrl($uri){ global $xcart_web_dir; $replacement = $uri; extract(parse_url($replacement)); $path = eregi_replace($xcart_web_dir,'',$path); if($scheme!='ftp' && $scheme!='mailto' && $scheme!='javascript'){ if($query && preg_match('@^home\.php$@i',$path)){ $gen_url = preg_replace_callback('@(.*)[&]*cat=([0-9]+)[&]*(.*)@i', array( &$this,'replaceCategoryUrl'),$query); } elseif($query && preg_match('@^product\.php$@i',$path)){ $gen_url = preg_replace_callback('@(.*)[&]*productid=([0-9]+)[&]*(.*)@i', array( &$this,'replaceProductUrl'),$query); } elseif($query && preg_match('@^image\.php$@i',$path)){ $gen_url = preg_replace_callback('@(.*)[&]*productid=([0-9]+)[&]*(.*)@i', array( &$this,'replaceImageUrl'),$query); }

I haven't been able to test this yet, please let me know if this corrects the problem

Thanks
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote