• Welcome to Simple Machines Community Forum. Please login or sign up.
January 21, 2022, 12:51:28 AM

News:

Wondering if this will always be free?  See why free is better.


Captcha at registration and message icons addition not working

Started by pulpfiction, December 27, 2006, 05:43:49 PM

Previous topic - Next topic

pulpfiction

Hello,

I was using SMF 1.1 and just upgraded to SMF 1.1.1 in hope these bugs would be fixed, but they aren't. Here they are:

Bug #1) Captcha at registration not working
If I enable captcha at registration (by disabling "Disable the use of the visual verification on registration"), the form just looks like captcha isn't enabled and when user try to register he gets the error "The letters you typed don't match the letters that were shown in the picture."
I don't know what it may be, any idea?  ???

Bug #2) MySQL error on tables when trying to add message icons
So I enable "Enable customized message icons" and click on the new menu item "Edit Message Icons". When I click at "Add New Icon" buttom I get the error "Unknown table 'b' in where clause
File: /home/myuser/domains/mydomain.com/public_html/forum/Sources/ManageSmileys.php
Line: 1128"
I also don't know what it may be, any idea?  ???

Thanks in advance.

SleePy

Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

pulpfiction

So what do you suggest me to do?

I was using RC3, then upgraded to 1.1 and finally to 1.1.1. No idea what it may be.

I can give you a test account so you can see it.

Greybrow

I have the same problem. But only, when I switch to Polish language.
Could it be, that I missed to copy some language files?
I searched the captcha files, but there seem not to be any special English folder for fonts/pics.
I only found English waves, but it's not the main problem.

pulpfiction: what language do you use?

pulpfiction

Quote from: Greybrow on January 08, 2007, 06:07:53 AM
I have the same problem. But only, when I switch to Polish language.
Could it be, that I missed to copy some language files?
I searched the captcha files, but there seem not to be any special English folder for fonts/pics.
I only found English waves, but it's not the main problem.

pulpfiction: what language do you use?

English. :(

It's definitely not the language.

Greybrow

When I switch back to English, the captcha picture appears as it should. So it its language file problem here.
Do you have GD on your server?
I had once strange problems with errors all over, but after clean install (renamed whole forum dir to old, and new files forum dir), all errors disappeared.

pulpfiction

Quote from: Greybrow on January 08, 2007, 03:01:54 PM
When I switch back to English, the captcha picture appears as it should. So it its language file problem here.
Do you have GD on your server?
I had once strange problems with errors all over, but after clean install (renamed whole forum dir to old, and new files forum dir), all errors disappeared.

I was about to try that one, glad to hear it worked for you. :)

denniso

Captcha at registration is not working on my site. No images are shown.

I made a clean install of SMF 1.1.1 and added the Swedish Language pack and TinyPortal v0.9.7.

However, Captcha at registration works without problem if I change the default forum language back to english. ::)

(Maybe I should mention that I first installed SMF into a subdirectory. All the files and directories in that directory was later moved to the root. I've made the necessary config changes and everything else works great.)

Any help will be appreciated!  :)
Best regards

// denniso

hxxp:english-thai-dictionary.com/ [nonactive]

denniso

Since nobody can help me out with this problem, I decided to try to find out about the problem with the visual verification code by my self.

When registering a new account an URL is generated for the visual verification image.

The URL looks something like:
http://chaimai.com/index.php?action=verificationcode;rand=be724dbeebeb0d794ec28fbc289b2aec

The registration page has an image tag referring to this URL.

If I manually enter the URL into the address bar in my Firefox web browser i get an error message indicating that there is an error in the image file. IE doesn't complain about it but it doesn't contain any output.

Then I replaced the complicated image generation code in Subs-Graphics.php with a simple one that I know works well in other situations. However the code that usually works doesn't output a valid image anymore ... 

If I change the following code in Subs-Graphics.php
// Show the image.
if (function_exists('imagegif'))
{
header("Content-type:  image/gif");
imagegif($code_image]);
}


into :

// Show the image.
if (function_exists('imagegif'))
{
header("Content-type:  image/gif");
imagegif($code_image, 'myfilename.gif');
}


The image file myfilename.gif is created and it looks great!!!!

So, I made a copy of the showCodeImage($code) function and put in a separate file. I just made some small modifications to it to remove the $context references. It still resides in the same directory as where my SMF forum resides. And guess what... It works! I just enter the new URL in the browser and a visual verification code image appears.

It seems there is something in the surrounding code causing the problem ... unfortunately I have no more ideas in how to troubleshout the problem further since everything works separately ..  ??? HELP!
Best regards

// denniso

hxxp:english-thai-dictionary.com/ [nonactive]

denniso

Hi!

I've done further testing ... nobody seems interested though ...  :-[

As I wrote before, if I switch the board language into english the visual verification code works again.
I downloaded new swedish language files (non UTF-8) and when I switched to these language files it worked. I converted them into UTF-8 character set and Unix line termination. It still worked great! Meaning: There is nothing wrong with the language files!

I renamed the 25 newly downloaded and modified swedish language files from xxxx.swedish.php to xxxx.swedish-utf8.php and activated the swedish-utf8 language in the Admin panel again causing the visual verification code to malfunction again.

(I also changed the variable $txt['lang_character_set'] to be 'utf-8' but it had no effect on the visual verification code.)

So, by switching to a UTF-8 encoded language in the Administration Center the visual verification code will stop working.


I am willing to do further testing but I don't have any ideas what to look for any more.  :-[
Best regards

// denniso

hxxp:english-thai-dictionary.com/ [nonactive]

pulpfiction

I have given up on this aswell. Nobody seems interested, worst community support ever. I'm moving away of SMF as soon as the script I have in mind has an import script for SMF.

spilo101

I am experiencing the same problem.. 

we have to patient, these guys are working hard on this project...

pulpfiction

Quote from: spilo101 on February 08, 2007, 09:52:22 PM
I am experiencing the same problem.. 

we have to patient, these guys are working hard on this project...

Yeah? This thread was abandoned since the "I can't reproduce either of the errors" reply.

denniso

It seems that it has to do with Tiny Portal together with UTF-8 language files...

I made the following discovery today and reported a bug at the TP site:

Quote from: My bug reportI just made a clean install of SMF 1.1.1 and after that I installed TP 0.97.

Visual verification at registration page stops working if I add the swedish TP UTF-8 language files and swedish is selected as the board language.

Actually it's only if I add TPortal.swedish-utf8.php or TPortalAdmin.swedish-utf8.php.

Just the presence of one of the above files makes SMF's visual verification stop working. No picture!! I tried with empty files and they have the same effect!!! It sounds strange but I am sure!

I upgraded SMF to 1.1.2 withot any problems but I can still not add the files without causing SMF to malfunction.

I've had the same problems on another site recently but I did not understand that this problem has to do with TP at that time.

Strange isn't it?

Visual verification works great if I just don't apply the swedish TP language files!!!
Best regards

// denniso

hxxp:english-thai-dictionary.com/ [nonactive]

Greybrow

I looked at the binary code of downloaded captcha image, at the beginning there is:
GIF89a
instead of
GIF89a

So it is caused by UTF-8

I tried with fresh install.
With English language files everything was ok.
I uploaded Polish UTF-8 translation, and captcha broke.
So I copied English translation over Polish one (changed filenames), and uploaded Polish translation files one by one, every time checking if captcha is working.

It stopped displaying the picture after I uploaded file Modifications.polski.php
This file was only 45 bytes long, and had no translations in it.
I looked into it with non UTF-8 viewer, and some familiar string came out at the beginning:
<?php
// Version: 1.1.2; Modifications

?>

I wrote some special Polish characters in comment inside the file, and after saving, the code at the beginning disappeared.
I uploaded it again and captcha started to work.
It also started to work without that comment, but with ANSI instead of UTF-8 coding.

So it seems that UTF-8 file has got to have some UTF-8 characters in it.
For me that only file was causing all the mess.

Can anyone confirm it?

denniso

@Greybrow ...

It looks like an UTF-8 BOM header (byte order marker) in the beginning of the image. That would corrupt the file of course.

I think UTF-8 BOM's should not be present in the language files. I will investigate further ...
Best regards

// denniso

hxxp:english-thai-dictionary.com/ [nonactive]

denniso

Confirmed!

UTF-8 BOM's should not be present in the language files.
Remove them and Visual Verification works again!!!!

This is a possible bug in SMF. I can't tell but I suggest that SMF start to remove possible BOMS when loading language files. It shouldn't be hard to fix.

Quote from: WikiFor example, gcc reports stray characters at the beginning of a source file, and in PHP, if output buffering is disabled, it has the subtle effect of causing the page to start being sent to the browser, preventing custom headers from being specified by the PHP script. The UTF-8 representation of the BOM is the byte sequence EF BB BF, which appears as the ISO-8859-1 characters "" in most text editors and web browsers not prepared to handle UTF-8.

See hxxp:en.wikipedia.org/wiki/Byte_Order_Mark [nonactive]

Regards.
Best regards

// denniso

hxxp:english-thai-dictionary.com/ [nonactive]

MrAnderson.cl

The question is... how do I remove UTF-8 BOM to make CAPTCHA work properly??

Thanks

Greybrow

For me it worked like this: I opened the file in editplus, chose "save as", then type "ansi" instead of "utf-8"

MrAnderson.cl

Wich files I have to edit for make captcha work??

I've edited Register.php and Subs-Graphics.php but it seems they're not the correct files...

Greetings

Greybrow

Did you read this thread? :)
That would be Modifications file, which is the smallest one.

MrAnderson.cl

Sorry I haven't noticed that file... I saved it in ANSI but it didn't solved the problem... CAPTCHA still not working...

What if I turn back to latin encoding modifying the database un mysql??

Greetings

thealx

Ok, I found the problem. It only occurs if TinyPortal is installed over the SMF and utf-8 encoding is in use.
To get rid of this, you have to remove the BOM signatures from these files
TPhelp.russian-utf8.php
TPmodules.russian-utf8.php
TPortal.russian-utf8.php
TPortalAdmin.russian-utf8.php
(hint: replace "russian" with your own language)

The simpliest way to do it: open a file in any of utf-8 capable text editors and save it as Unicode (UTF-8 Without Signature) - Codepage 65001. Visual Studio 2005 has done this conversion well for me.

Greybrow

So still it seems that it is an bug in smf, that it doesn't take care of those boms.

MrAnderson.cl

Quote from: MrAnderson.cl on March 12, 2007, 11:45:52 PM
Sorry I haven't noticed that file... I saved it in ANSI but it didn't solved the problem... CAPTCHA still not working...

What if I turn back to latin encoding modifying the database un mysql??

Greetings

Problem solved... at least in my forum... the problem was the Joomla/SMF bridge...

Greetings

flash_os


MrAnderson.cl

In our case the problem was that we had redirected Joomla index manually... so the captcha didn't worked at all... once we redirected Joomla index automaticallly through the configuration... the problem got solved...

Check this couse maybe some of you may have the same problem...

Greetings

flash_os

My problem was solved by removing the BOM signature from all php files in Babylon directory.
Removed BOM with EditPad Lite.
Thanks to greyknight17.

hobox

Great post!

For me it was enough to just remove the BOM from TPortal.swedish-utf8.php.


dxyy

I'm also having a problem with my visual verification when using simplified Chinese.

I don't use Tiny Portal or anything else but SMF. :(

I tried replacing the modifications.chinese-simplified-utf8.php, but that didn't seem to help.
I've tried some of the other things mentioned in this thread, but nothing has worked so far. The visual verification works fine if I'm using English.

Any help available with this?

Thanks. :)

PS: Link to my forum can be found in my signature. ;)

Ambasador

Quote from: Greybrow on March 12, 2007, 04:14:08 PM
Did you read this thread? :)
That would be Modifications file, which is the smallest one.

Well it's not the smallest for all of us, but it is the one with the bug! Just converted mine (Serbian latin and Serbian Cyrilic) to ansi, and guees what, it works!

QuoteI tried replacing the modifications.chinese-simplified-utf8.php, but that didn't seem to help.

Try to copy modifications.english.php to your server and rename it on the spot.


dxyy

It seems that as long as I save my Modifications.chinese-simplified-utf8 as utf-8 that the captcahs do not work if someone uses Chinese. When I am using English everything is fine.

Is this a bug? ???

EDIT: Also, if I modify the index.chinese-simplified-utf8 file (even though it was already saved as utf-8) the captcha stops working! Gosh, is this problem only something I am experiencing? :(

Advertisement: