Jump to the post that solved this thread.
Solved: 1 Year, 11 Months, 2 Weeks ago URL incomplete link in a post
#1
Solved: 1 Year, 11 Months, 2 Weeks ago
It looks like the ampersand breaks the URL link when it's copy/pasted in a post.
1.8.32

This isn't the way it used to be treated. Is it a mycode problem?

   
Reply
#2
Solved: 1 Year, 11 Months, 2 Weeks ago
https://community.mybb.com/thread-237311...test=3+456

Seems okay here. Maybe this was posted in the WYSIWYG editor and it's pasted in a partial link.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply
#3
Solved: 1 Year, 11 Months, 2 Weeks ago
No. I almost always use Quick Reply, otherwise Source Mode is on in WYSIWYG editor.

I'll have to dig into it. I suspect a Mycode alteration, and a clash of priority.

All Mycodes are disabled -- no change.

Link posts fine here.
https://duckduckgo.com/?t=ffab&q=ampersa...definition

Insert a link works fine there.
Pasted link still parses incomplete.
   

Results of File Verification.
   

Using Meld to compare files, all core mods seem valid.
jscripts/bbcodes_sceditor.js simply changes the order of videos in the Insert Video dropdown box.
inc/functions.php is modded by Absolute Time plugin. Deactivating plugin results in not listed in File Verification results.
inc/class_parser.php is modded only to reveal tiny type problem.
   
Reply
#4
Solved: 1 Year, 11 Months, 2 Weeks ago
I came across this bug a while back, and discovered that it only occurred when HTML is allowed. I don't remember digging deeper than that.

Have just dug deeper. The problem is on line #1693 of inc/class_parser.php. As you can see in the comment on that line, this part of the regex assumes that characters have been encoded, but when HTML is enabled, the call to $this->parse_html($message); on line #192 of that same file is skipped, and thus that assumption is violated, because characters have not been encoded (because it is the parse_html() method that encodes them).
Reply
#5
Solved: 1 Year, 11 Months, 2 Weeks ago
Hey Laird, thanks for that search. I will dig deeper even still when I return in a couple days.
Reply
#6
Solved: 1 Year, 11 Months, 2 Weeks ago
I hope you don't feel miffed that I've deprived you of a bit of debugging fun, but I have a little something for you to try to see whether it fixes the problem (hopefully without unwanted side-effects!). There are other ways to solve this problem, but see what you think of this one:

Change the above-mentioned line #1693 of inc/class_parser.php from:
					(?:/(?:[^\"\s<\[&]|\[\]|&(?:amp|lt|gt);)*)?	# path, query, fragment; exclude unencoded characters
to:
					(?:/(?:[^\"\s<\[&]|\[\]|&(?:amp|lt|gt);|&(?!((amp|lt|gt);)))*)?	# path, query, fragment; handle unencoded ampersands for when HTML is enabled
Reply
#7
Solved: 1 Year, 11 Months, 2 Weeks ago
This part of inc/class_parser.php is now line 1693 in version 1.8.33

I have made the change, and it fixes the mycode_auto_url function when HTML is enabled.
Thanks.
+1
Reply
#8
Solved: 1 Year, 11 Months, 2 Weeks ago
(2023-02-04, 10:25 PM)HLFadmin Wrote: This part of inc/class_parser.php is now line 1693 in version 1.8.33

Oops - typo. Fixed in my post above.

(2023-02-04, 10:25 PM)HLFadmin Wrote: I have made the change, and it fixes the mycode_auto_url function when HTML is enabled.
Thanks.
+1

Great to hear. Thanks for testing and accepting my fix.
Reply
#9
Solved: 1 Year, 11 Months, 2 Weeks ago
Solved the problem here also after update from 1.8.33 to 1.8.34, now on line 1707.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 2 Guest(s)