'Historically, we may regard materialism as a system of dogma set up to combat orthodox dogma...Accordingly we find that, as ancient orthodoxies disintegrate, materialism more and more gives way to scepticism.'
- Bertrand Russell
Reply
1
The following 1 user Likes Sci's post:1 user Likes Sci's post • Laird
I haven't deliberately changed anything, and none of the other admins are active so they wouldn't have either, so I don't know what's going on there. We did a while back disable the deleting of threads just because we didn't think it was fair that people could delete others' posts, so maybe it's the opening post of a thread you're wanting to delete?
Reply
1
The following 1 user Likes Laird's post:1 user Likes Laird's post • Sci
(2024-07-15, 12:57 AM)Laird Wrote: I haven't deliberately changed anything, and none of the other admins are active so they wouldn't have either, so I don't know what's going on there. We did a while back disable the deleting of threads just because we didn't think it was fair that people could delete others' posts, so maybe it's the opening post of a thread you're wanting to delete?
I seeem to recall seeing (and occasionally using) a "delete" option for individual posts in a thread.
The problem was subtle: a comparison in MyBB core code between a variable and the integer 0 assumed that the comparison would be true when the variable is an empty string, but that is no longer the case in PHP 8, to which (PHP 8) I upgraded our hosted psiencequest.net domain a little while back when it (finally, good Lord) was made available by Hostgator. I've updated the comparison in that core code to use boolean false rather than integer 0.
I've added filing an issue (bug report) on GitHub for this to my (long) list of other MyBB issues requiring a bug report.
If my fix is overwritten in a subsequent upgrade prior to the issue being fixed, here's a record of the fix that will need to be replicated:
(2024-07-15, 11:47 PM)nbtruthman Wrote: Test post for display formatting
Yeah, there were more problems in core code caused by changes to the output of the `highlight_string()` function. I think I've fixed them. I'll again make a note to (eventually, I hope) file a bug report for this on GitHub. In the meantime, here's a record of the fix we might need to reimplement after an upgrade:
if(!empty($this->options['allow_mycode'])) { // Now that we're done, if we split up any code tags, parse them and glue it all back together if(count($code_matches) > 0) { foreach($code_matches as $text) { if(my_strtolower($text[1]) == "code") { // Fix up HTML inside the code tags so it is clean $text[2] = $this->parse_html($text[2]);
if(!isset($this->options['nl2br']) || $this->options['nl2br'] != 0) { $message = nl2br($message); // Fix up new lines and block level elements $message = preg_replace("#(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)\s*<br />#i", "$1", $message); $message = preg_replace("#( )+(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)#i", "$2", $message); }
with:
PHP Code:
if(!isset($this->options['nl2br']) || $this->options['nl2br'] != 0) { $message = nl2br($message); // Fix up new lines and block level elements $message = preg_replace("#(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)\s*<br />#i", "$1", $message); $message = preg_replace("#( )+(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)#i", "$2", $message); }
if(!empty($this->options['allow_mycode'])) { // Now that we're done, if we split up any code tags, parse them and glue it all back together if(count($code_matches) > 0) { foreach($code_matches as $text) { if(my_strtolower($text[1]) == "code") { // Fix up HTML inside the code tags so it is clean $text[2] = $this->parse_html($text[2]);
Also, edit the templates `mycode_php` and `mycode_code` to strip the trailing `<br />`.
Reply
(This post was last modified: 2024-07-16, 05:10 PM by Laird. Edited 2 times in total.
Edit Reason: Update the fix slightly, esp. for backwards compatibility, and add a template-editing note
)