PDA

View Full Version : Solved HTML Comments displayed in reported post username



moman
07-08-10, 12:58
This minor bug occurs when a post by a user with a translated username is reported to a moderator and posted to a thread. The HTML comments are shown because they are converted to HTML-safe characters prior to the global hook being run.

Before-
http://img39.imageshack.us/img39/7610/screenshot4ij.png

After-
http://img833.imageshack.us/img833/1936/screenshot5r.png

Fix-
In functions_vbenterprisetranslator_hooks.php find:

if (strpos($output,'<!--vBET_ENTA-->')) {
$output =& str_replace(array('<!--vBET_SNTA--><!--vBET_NRE-->',
'<!--vBET_ENTA-->'), '', $output);

Replace with:

if (strpos($output,'<!--vBET_ENTA-->') || strpos($output,'&lt;!--vBET_ENTA--&gt;')) {
$output =& str_replace(array('<!--vBET_SNTA--><!--vBET_NRE-->',
'<!--vBET_ENTA-->','&lt;!--vBET_SNTA--&gt;','&lt;!--vBET_ENTA--&gt;'), '', $output);

There's probably a smarter fix that would allow these comments to be used i.e. in 'code' bbcode, but that's not a concern in my case.

kamilkurczak
09-08-10, 09:41
Ok. So I need to reproduce this bug on my forum test. How can I do that? May be this is a conflict with another mods? Can you check it (find a conflict).
I will try to confirm it. I will show this solution to MichaƂ.
Thanks

moman
09-08-10, 10:13
If you make a post in a language different from the forum's default, then usernames are stored with snta and enta tags around them in the database. Simply report such a post, and in the auto-generated thread, the linked username will include the comments.

kamilkurczak
10-08-10, 11:36
I can't reproduce this issue on my test forum.

of course I need to know - may be conflict. I should describe how to find conflict in previous post, so I describe it now.

please, Turn off all other mods one by one (vBET must be enabled) and try to find this issue again. If one of this mods is disabled and you can't fint this issue - we have a conflict with this mod.

So, please try to find this conflict:)

moman
10-08-10, 11:46
I can't do that on my forum right now, as it's a live site, not a test site.

Here's the information I can provide you with:
1. The SNTA and ENTA comments are saved within the 'postusername' field in the 'post' table in the database.
2. When the report is made, vBulletin fetches the username from that field, and thus, the comments are shown.

If you can't find the bug, no worries- it might be specific to my site, even though I doubt that.

vBET
11-08-10, 18:25
There is no column 'postusername' in 'post' table. I suppose this column was added by some mod - in this case this should be concern as some integration issue. But we do not know with which mod.

Post table do have column 'username' - but there no value with NTA tags. I checked it in our database by this query:

SELECT * FROM post where username like '%SNTA%'
And in our forum there is lot of messages written in different languages.

Can you determine which of your mods added 'postusername' column to your 'post' table. That would be helpful to find out what is going on there. At this moment I move this thread to troubleshooting section, and we will move it to integration section when we will know with which mod we integrate here.

moman
12-08-10, 11:49
I think I meant username. I'll provide you with a screenshot shortly.

moman
12-08-10, 11:57
It was indeed the username field.

See here for an example:

Interestingly, not all translated posts contain ENTA and SNTA tags around the username.

http://img265.imageshack.us/img265/2383/97408180.gif

BTW- you should increase resolution restrictions on attached images.

kamilkurczak
12-08-10, 12:35
ok, this is a 'username'. now it is correct.

If you can't find the bug, no worries- it might be specific to my site, even though I doubt that.
ok, but we would like to make a Integration Guide with a mod, which causes this bug. (if this is an issue caused by the conflict).

secondly - we would like to confirm your solution for our members.

moman
14-08-10, 19:31
Are you sure this is caused by a conflict, and just doesn't happen under specific circumstances? Unfortunately, I can't really do any further tests at my end. Only 8 posts in my entire database have usernames with NTA comments wrapped around them. Also, note that the translation system is used extensively on my site- the cache database can grow to 10Gb+. This must therefore mean one two things: either the bug existed in the past and is now fixed, or that the bug occurs very rarely.

Have you checked your post table on the database on this site?

kamilkurczak
17-08-10, 10:03
yes, we are checked it and on our test forum (and on our main forum of vBET) everything is working good.

moman
17-08-10, 18:59
Ok- chances are that the bug is old and has been fixed,then. I am having a new issue with PHP that I've posted in this forum as well, if you could check that for me.

kamilkurczak
19-08-10, 08:41
As I see on your forum - this is working now, solved

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Translations delivered by vB Enterprise Translator 4.10.1