mChat

Can't post automatically parsed URLs - mChat

Can't post automatically parsed URLs

by StevieWonderer » Fri Oct 11, 2019 4:50 pm

Thanks again for this great extension.

I'm just wondering if the permission "Can post automatically parsed URLs" works like intended.

When user does have "Can post automatically parsed URLs" permission but does not have "Can use BBCodes" permission, the result is that URLs the user has posted are not clickable.

This can be fixed in core.modify_text_for_storage_before event but I don't like that solution very much.

Perhaps dmzx\mchat\core\mchat.php:1455
$mchat_img = $mchat_flash = $mchat_quote = $mchat_url = $mchat_bbcode;
should be something like
$mchat_img = $mchat_flash = $mchat_quote = $mchat_bbcode;
$mchat_url = true;
???
StevieWonderer
Registered User
Posts: 26
Joined: Wed Oct 12, 2011 1:06 am
Contact:

Re: Can't post automatically parsed URLs

by kasimi » Fri Oct 11, 2019 7:53 pm

A clickable URL means the URL BBCode is automatically applied to the plain-text URL. If the user doesn't have permission to use BBCodes, this can't happen. In other words: in order for the permission Can post automatically parsed URLs to take effect, the user must have the permission Can use BBCodes. As far as I can see, the code is working fine according to these rules.
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3936
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Can't post automatically parsed URLs

by StevieWonderer » Sat Oct 12, 2019 3:30 am

kasimi wrote: A clickable URL means the URL BBCode is automatically applied to the plain-text URL. If the user doesn't have permission to use BBCodes, this can't happen. In other words: in order for the permission Can post automatically parsed URLs to take effect, the user must have the permission Can use BBCodes. As far as I can see, the code is working fine according to these rules.
In that case, what is the purpose of the "Can post automatically parsed URLs" permission? If a user is allowed to use BBCodes, why would any admin force his users to use URL BBCode instead of letting phpBB parse URLs automatically for them?

Also, automatically converted URLs are not converted to BBCode. In database, automatically converted URL looks like this:

Code: Select all

<URL url="https://www.phpbb.com/">https://www.phpbb.com/</URL>
BBCode URL looks like this:

Code: Select all

<URL url="https://www.phpbb.com/"><s>[url]</s>https://www.phpbb.com/<e>[/url]</e></URL>
StevieWonderer
Registered User
Posts: 26
Joined: Wed Oct 12, 2011 1:06 am
Contact: