MyBB Community Forums

Full Version: bug when quoting a Guest user
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I allow users to post as guests without registering, and when they do, the displayed username is "Guest"

When I go to quote their posts however, MyBB doesnt quote their username. Instead, it quotes an empty username. The code gets populated like so:

[quote="" pid='13113' dateline='1635521798']

As you can see, the username is empty, where it should say "Guest"

It used to say "Guest". I don't know when it changed. I believe I upgraded from 1.8.20 to 1.8.27 when I first noticed it, but I cannot be sure if the starting version was .20 but I just upgraded today to 1.8.28 now the bug still appears
open /inc/class_parser.php enter
below code online line 985
$username = ($username ==="")?"Guest":$username;
before below code
		if($text_only)
		{
.....
(2021-10-29, 08:51 PM)Mostafa.Shiraali Wrote: [ -> ]open /inc/class_parser.php enter
below code online line 985
$username = ($username ==="")?"Guest":$username;
before below code
		if($text_only)
		{
.....


This works after I post my reply. This changes the display.

But the quote code that gets input into the newreply still shows up blank username
This was probably applied to comply with out multiple language support approach. "Guest" is an English word after all.
(2021-10-29, 10:15 PM)mikew Wrote: [ -> ]
(2021-10-29, 08:51 PM)Mostafa.Shiraali Wrote: [ -> ]open /inc/class_parser.php enter
below code online line 985
$username = ($username ==="")?"Guest":$username;
before below code
		if($text_only)
		{
.....



This works after I post my reply. This changes the display.

But the quote code that gets input into the newreply still shows up blank username

Guest don't have user account , so no need username,for example if  3 Guest quote post in thread , for every one show what?
(2021-10-30, 12:59 AM)Omar G. Wrote: [ -> ]This was probably applied to comply with out multiple language support approach. "Guest" is an English word after all.
What is interesting is that

I have the option to allow users to type in a guest name as well (still with no user account). And if they do that, then quoting DOES quote the name they typed in.

However, if they don't type a name in, and the name defaults to "Guest", then quoting does not work, and quotes empty username


(2021-10-30, 09:19 AM)Mostafa.Shiraali Wrote: [ -> ]Guest don't have user account , so no need username,for example if  3 Guest quote post in thread , for every one show what?
They should all quote "Guest"
You can type any string you like, yes, but the core can't endorse a specific word for "guest" because it would break the multi language support. I think this is the reasoning "guest" was removed from several hard-coded uses.
More info:

When I click the "Reply" button to go to the full editor, the quote code looks like this:

[quote pid="13113" dateline="1635521798"]

This doesnt even render properly at all.


When I click "Quote" and then in the Quick Reply box I click the link for "Quote these posts now", then I get this code with the empty username:

[quote="" pid='13113' dateline='1635521798']

Certainly this must qualify as a bug


(2021-10-30, 09:25 PM)Omar G. Wrote: [ -> ]You can type any string you like, yes, but the core can't endorse a specific word for "guest" because it would break the multi language support. I think this is the reasoning "guest" was removed from several hard-coded uses.
Pressing the 'Quote' or 'Reply' button should insert the quote bbcode based upon the display name already shown. Where in the codebase is this function implemented? What file?
(2021-10-31, 12:50 AM)mikew Wrote: [ -> ]More info:

When I click the "Reply" button to go to the full editor, the quote code looks like this:

[quote pid="13113" dateline="1635521798"]

This doesnt even render properly at all.


When I click "Quote" and then in the Quick Reply box I click the link for "Quote these posts now", then I get this code with the empty username:

[quote="" pid='13113' dateline='1635521798']

Certainly this must qualify as a bug

Thanks, we've added it on GitHub: https://github.com/mybb/mybb/issues/4492
(2021-11-08, 01:49 PM)Devilshakerz Wrote: [ -> ]Thanks, we've added it on GitHub: https://github.com/mybb/mybb/issues/4492

Thank you, I see someone added a PR to solve it:
https://github.com/mybb/mybb/pull/4493/files

same solution from this link:
https://www.mybb.de/forum/thread-35184.html

This solution DOES work for both quick reply quoting, AND for full editor quoting
Pages: 1 2