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 ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

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

Advertisement: