Encoding Issue - themes.inc.php (customisation of file) Encoding Issue - themes.inc.php (customisation of file)
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Encoding Issue - themes.inc.php (customisation of file)

Started by gurdip, June 06, 2009, 08:27:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gurdip

Hi,

I have integrated Paypal for Coppermine for my English language gallery, something that I have done successfully in the past while testing. Yesterday, I did the same and when I clicked Add to Cart, the Paypal screen showed this error message:

"Data does not match input character set or default encoding. For more information, please contact the merchant."

I had a past version of the integrated file and uploading that solved the issue and I was able to see the paypal cart with the selected image. Problem is that this old file needs to have the image costs updated but I can't seem to open the file, make changes and resave without causing the encoding issue.

I believe the original file was encoded in utf-8, but loading and saving in that encoding does not work. I have tried others, including us-ascii (my cpanel was detecting this, as well as ISO 8859-1 - no success.

Anyone can give ame a clue on how I can make changes to my themes.inc.php file without running into this encoding problem? Been working on it like 2 days so help is very much appreciated.

Thanks in advance.





gurdip

Hi again,

I'd like to add the following:

- I'm using Filezilla for FTP
- Crimson Editor for making changes
- I have searched the forum but wasn't able to find a solution that worked.

thnx

Joe Carver

The first thing you should do is to follow the rules of the forum. Otherwise your postings will be ignored.
Maybe one of your days and one of your postings could have been saved had you read the help request guidelines.

  • Post a link to your gallery.
  • Do not double post with triival details

gurdip

Hi,

The gallery was restricted by password; I've removed it and you can now see it here: http://gallery.singaporekhalsa.org.sg/displayimage.php?album=12&pos=1.

I realised posters were sometimes asked about software they were using so decided to add that info in the second post in case it was important.

Looking forward to anyone who can shed some light on the issue I'm having.

Thanks

Joe Carver

Wow!
You are very, very much behind using
Quote<!--Coppermine Photo Gallery 1.4.16 (stable)-->

You should update as soon as possible.

Afterwards see if your site validates here:  http://validator.w3.org/


gurdip

Yes it needs to be updated. The Paypal integration worked well on this version when I first tested it. Later upon approval to set up the gallery, I tried a later version but that failed - could not figure it out. So now I'm back to version 1.4.16 as a stop-gap measure until I can figure out what's the problem with the integration code.

Validated the site and it does show errors - will work on that soon. The encoding issue is not related to this is it?

Point to note: I have an earlier version of themes.inc.php but that works very well; only can't be edited.

Thanks

phill104

The encoding issue may or may not be related to this but unless you upgrade supporters are unwilling to help. There is little point fixing something on this version if you are going to upgrade is there.

In your case, you need to upgrade straight away as you are at risk of having your work destroyed by the nasy hackers out there that are actively looking for sites such as yours to destroy or abuse.
It is a mistake to think you can solve any major problems just with potatoes.

Joachim Müller

The approach to edit include/themes.inc.php is wrong in the first place and the reason why you're so picky about updating. That's why we say never to edit that file, under no circumstances. Everything that can be accomplished by editing that file can be accomplished as well by editing your custom theme. As suggested: upgrade! There's no alternative. You're a sitting duck if you don't.

gurdip

Hi,

I setup a new gallery using the latest version: 1.4.24. You can see it here http://photogallery.singaporekhalsa.org.sg.

In most circumstances there is no need to edit themes.inc.php as recommended. Only reason I'm doing this is to apply the Paypal Modification for Coppermine by Walter Rowe.

Have tested it before and it worked fine; but even with the new version I'm getting the encoding error. File encoding on my Crimson Editor is set to utf-8 Encoding (with BOM). Is this correct? I tried editing & saving the file using cPanel's file manager and was prompted to specify the encoding - I selected utf. But got the same problem when I saved it.

Rowe's modified version, btw, works without changes. All I need to do is open and save the file and the error occurs.

Any ideas?

thanks

Joachim Müller

Quote from: gurdip on June 15, 2009, 07:04:39 PM
In most circumstances there is no need to edit themes.inc.php as recommended. Only reason I'm doing this is to apply the Paypal Modification for Coppermine by Walter Rowe.
Still not necessary.

First of all, you should "tell" your browser what encoding to use - edit http://photogallery.singaporekhalsa.org.sg/themes/skapix/template.html, find<html dir="{LANG_DIR}">and replace with<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">,but that probably won't make a difference - it's mainly for standard compliance.

Quote from: gurdip on June 15, 2009, 07:04:39 PM
File encoding on my Crimson Editor is set to utf-8 Encoding (with BOM). Is this correct?
Use utf-8 without BOM if you can.

What FTP app do you use to upload?

gurdip


Joachim Müller


gurdip

I tried your suggestions:

1. changed info at start to: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">

2. Used utf-8 Encoding (w/o BOM).

I'm still getting the same error.

Not sure if this matters: 
When I open any Coppermine file in Crimson Editor, the document encoding appears as: ASCII Encoding. When I select utf-8 Encoding (w/o BOM), the editor prompts with "Do you want to reload the document?". I answer Yes to this before making the changes. As for Filezilla, the transfer mode is set to Auto.



gurdip

Read somewhere that i can get around this by adding charset=utf-8 to the Paypal string.

So I changed this:
https://www.paypal.com/cgi-bin/webscr

to

https://www.paypal.com/cgi-bin/webscr?cmd=_cart&charset=utf-8

This works fine. I would nevertheless like to find out why I'm suddenly unable to edit the files; so will leave my thread as unsolved if that's ok.

Thanks for looking into this and taking the time to answer.

Joachim Müller

We can hardly advice you how to use your editor...