Code: Select all
\/- We need a space here between the tag name and attribute.
<textareaname="message" id="message" rows="15" cols="76" ...
I managed to still make a post by using dev tools and restoring the message field.
After that a few things happened:
- I talked to Krom, who's going to look into upgrading phpBB
- Dwedit (who's also active here) made a userscript for Tampermonkey which I improved slightly, included below.
- I noticed that the same bug happened on Ben Hecks's forum as well.
Code: Select all
// ==UserScript==
// @name Fix GBADEV forum
// @namespace http://www.dwedit.org/
// @version 0.2
// @description Fix invalid HTML tag for the posting textarea
// @author Dwedit
// @author nitro2k01
// @match https://forum.gbadev.org/*
// @match https://forums.benheck.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
//Code to replace an HTML tag name
//https://stackoverflow.com/questions/15086677/replace-specific-tag-name-javascript
function changeTag(el, newTagName = "div") { var newEl = document.createElement(newTagName); [...el.children].forEach(o => newEl.appendChild(o)); [...el.attributes].forEach(o => newEl.attributes.setNamedItem(o.cloneNode())); el.parentNode.replaceChild(newEl, el); return newEl; }
var elements = document.getElementsByTagName("textareaname=\"message\"");
if (elements !== undefined && elements.length > 0)
{
var element = elements[0];
element.setAttribute("name","message");
// Preserve the message for edit/preview. Trim the string to get rid of annoying whitespace at the end of the string.
var message=element.innerHTML.trim();
var newEl=changeTag(element, "textarea");
newEl.innerHTML=message;
}
})();