News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

UTF-8 BOM in /file_check.php Utility?

Started by BigDaddyDiesel, August 20, 2009, 08:54:12 AM

Previous topic - Next topic

BigDaddyDiesel

What does that mean?  I have several files that say that a UTF-8 BOM detected? 

Also, what would cause hundreds of php files to wind up with the same exact error?  The main thing I am running into is that they all have extra spaces or line after the last ?>...  OR they begin with <? instead of <?php....   Any real rhyme or reason as to what would cause this?

Norv

The reason is typically that when you open and save SMF files, you may have used an editor that inserts BOM (=byte order mark) in the file when saving it, and did that on a core SMF file.

Definition from http://www.ibm.com/developerworks/wikis/display/xdcomputegrid/Glossary
Quote
byte order mark (BOM)
A character code at the beginning of a data stream that can be used as a signature that defines the byte order and encoding form.

Please use an editor who DOESN'T insert this character. For instance, if you're on windows, Notepad++ might be good.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

BigDaddyDiesel

Ok, so what you are saying is that to fix this issue, get a fresh copy of the file, and copy and paste it through notepad and then upload it to replace the code that was added?

Norv

Notepad++, not Notepad, I'd say.

I think you can also open the files that have BOM, using Notepad++, and remove the BOM. Check Notepad++ menu for options how to see BOM if you don't see it by default.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

BigDaddyDiesel

Thank you, that was going to be my next question.  How to see the BOM.  I will get to work on that.

Since you gave me the tools to work with, I guess you can mark this one solved..


Thanks again!!!

Tyrsson

PM at your own risk, some I answer, if they are interesting, some I ignore.

Norv

We should keep the topic unsolved though, in case there are more issues, until it really gets solved.

Eventually, please let us know how it goes.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Amoreitalia

Hello Norv. Im having an issue with this. I dotn know what file/files I may have messed up with the BOM If i even did that?

Norv

Please download the file_check tool attached here, upload it to your forum directory, and run it by pointing to it in the browser. It will check the files and tell whether they start and finish as expected for most php files in SMF, but also whether they have BOM.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Amoreitalia

Quote from: Norv on October 08, 2009, 08:40:58 PM
Please download the file_check tool attached here, upload it to your forum directory, and run it by pointing to it in the browser. It will check the files and tell whether they start and finish as expected for most php files in SMF, but also whether they have BOM.

ok cool i did so and i got this...


•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/index.php
◦File does not begin with <?php
◦File does not end with ?>
•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/ssi_examples.php
◦File does not end with ?>
•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/Themes/babylon/languages/Settings.german-utf8.php
◦File does not end with ?>
•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/Themes/default/languages/Settings.french-utf8.php
◦File does not end with ?>
•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/Themes/default/languages/Settings.english-utf8.php
◦File does not end with ?>
•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/Themes/default/languages/Settings.german-utf8.php
◦File does not end with ?>
•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/Themes/classic/languages/Settings.french-utf8.php
◦File does not end with ?>
•/var/www/vhosts/CamGirlEuphoria.com/httpdocs/forum/Themes/classic/languages/Settings.german-utf8.php
◦File does not end with ?>

Tyrsson

Please attach the top level index.php file to your next post.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Amoreitalia


Amoreitalia

Quote from: Tyrsson on October 08, 2009, 09:39:03 PM
Please attach the top level index.php file to your next post.

ahh ok i think i have an idea? the index.php file i edited some to add my sites header and footer. is there a work around for this?



AHH thats it! I jsut took out the header and footer i put in there and it all works fine. maybe you can help me keep teh header and footer in there but help me with a work around?

Tyrsson

The header and footer will go in the index.template.php file for the theme you are wanting to use. If you post the code and the index.template.php file then I can see what I can do. Or if you prefer you can email them to me at

jsmith[ @ ]simplemachines.org

Just please reply here or PM me to let me know you sent them.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Amoreitalia

Quote from: Tyrsson on October 09, 2009, 03:11:20 AM
The header and footer will go in the index.template.php file for the theme you are wanting to use. If you post the code and the index.template.php file then I can see what I can do. Or if you prefer you can email them to me at

jsmith[ @ ]simplemachines.org

Just please reply here or PM me to let me know you sent them.

Hey thanks so much for the help. I have run into a little error here. Anyway we can chat on a messenger? instead of posting b ack and fourth? lol. I have them all if you dont mind pming me one of yours?

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: