Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

& been replaced by & breaking error reporting


8 replies to this topic

#1 Shadow-Lord

  • Community Member
  • 148 posts
  • Real Name:Shadow
  • Gender:Male

Posted 08 December 2011, 04:30

In includes\functions\html_output.php
		if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
		  $link = str_replace('?', '/', $link);
		  $link = str_replace('&', '/', $link);
		  $link = str_replace('=', '/', $link);
		} else {
		  $link = str_replace('&', '&', $link);
		}


This is breaking error reporting in some modules.

In Sage Pay the error url should be:
http://www.example.com/checkout_payment.php?payment_error=sage_pay_server&error=4000


but it is been changed to:
http://www.example.com/checkout_payment.php?payment_error=sage_pay_server&error=4000


So no error description is shown.

#2 Monika in Germany

  • Community Member
  • 4,860 posts
  • Real Name:Monika
  • Gender:Female
  • Location:Frankfurt, Germany

Posted 08 December 2011, 09:03

did you try commenting out


$link = str_replace('&', '&', $link);
:-)
Monika

addicted to writing code ... can't get enough of databases either, LOL!

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

Interactive Media Award July 2007 ~ category E-Commerce
my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

#3 Shadow-Lord

  • Community Member
  • 148 posts
  • Real Name:Shadow
  • Gender:Male

Posted 10 December 2011, 20:04

Hi,

That could be done, but is there any other way to do this so that it will keep the page Search Engine Friendly.
Is there another way to add a variable to a link without using the '&'.

#4 Monika in Germany

  • Community Member
  • 4,860 posts
  • Real Name:Monika
  • Gender:Female
  • Location:Frankfurt, Germany

Posted 10 December 2011, 20:14

commenting out that line will make the page not be search engine friendly anymore?
:-)
Monika

addicted to writing code ... can't get enough of databases either, LOL!

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

Interactive Media Award July 2007 ~ category E-Commerce
my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

#5 HuskyDog

  • Community Member
  • 34 posts
  • Real Name:Ian Beadle

Posted 11 December 2011, 00:43

I have had the same problem with the contribution "Shopping Cart as Tooltip". You get an error "not found on this server" because the url changes from & to & when clicked.
I changed the html_output from:
$link = str_replace('&', '&', $link);
to
$link = str_replace('&', '&', $link);

This works, but it invalidates the code on the pages. This is the error:
& did not start a character reference (& probably should have been escaped as &)

On the "Shopping Cart as Tooltip" contribution page someone wrote:

That is except i have Ultimate SEO URLs installed and get this message when I click on Buy Now:
The requested URL /catalog/microsoft-intellimouse-explorer-p-26 was not found on this server.
But Backspace fixes this.

So it seems for them Backspace fixed the problem. I just don't know what this refers to. If it does work somehow, it may fix the problem in SagePay too.

Anybody have any ideas?

#6 Jack_mcs

  • Community Member
  • 24,454 posts
  • Real Name:Jack
  • Gender:Male

Posted 11 December 2011, 02:38

View PostShadow-Lord, on 10 December 2011, 20:04, said:

Hi,

That could be done, but is there any other way to do this so that it will keep the page Search Engine Friendly.
Is there another way to add a variable to a link without using the '&'.
That option had problems in pre-2.3 shops. I don't know if it still does but, in the least, the url's it generates have never has been considered very good with regards to seo so most shop owners, in my experience, opt for one of the url rewriter contributions. So before you get too many url's indexed, you may want to give a thought to whether you want to switch or not.

#7 HuskyDog

  • Community Member
  • 34 posts
  • Real Name:Ian Beadle

Posted 11 December 2011, 02:59

Hi Jack,
Is there some way that I can get the "Shopping Cart as Tooltip" contribution working without having to change this: $link = str_replace('&', '&', $link);

It is pretty much the same problem as Shadow_lord is having, with the & changing to & in the url. I don't want to change to using a url rewriter. Maybe in .htaccess is there a way to just rewrite the & symbol?

#8 Jack_mcs

  • Community Member
  • 24,454 posts
  • Real Name:Jack
  • Gender:Male

Posted 11 December 2011, 14:54

View PostHuskyDog, on 11 December 2011, 02:59, said:

Hi Jack,
Is there some way that I can get the "Shopping Cart as Tooltip" contribution working without having to change this: $link = str_replace('&', '&', $link);

It is pretty much the same problem as Shadow_lord is having, with the & changing to & in the url. I don't want to change to using a url rewriter. Maybe in .htaccess is there a way to just rewrite the & symbol?
Any problem/question regarding a contribution should be asked in that contributions thread since that is where the people that update and use it are likely to see it. I'm not familiar with that contribution so I can't offer any thoughs on it.

#9 HuskyDog

  • Community Member
  • 34 posts
  • Real Name:Ian Beadle

Posted 16 December 2011, 02:36

Hi Shadow-Lord,

You can add the following code to your .htaccess file to rewrite & to & which should solve your problem.

RewriteCond %{QUERY_STRING} ^(.*)&(.*)$
RewriteRule ^(.*)$ /$1?%1&%2 [L,R=301]

Best regards,

Ian