I have a website built with MediaWiki CMS which I host on a CentOS based Apache "shared server environment" (SiteGround) in which I can partially control Apache by:

  • .htaccess files
  • SSH
  • Some Cpanel tools

Background to understand my problem

My website contains a ContactPage contact form in which the subject field is hardcoded into the form wrapper via PHP;
This is odd, because all other fields aren't hardcoded like this and are actually optional and injected into the wrapper from the form's default template which I pasted into the main customization file of the CMS (LocalSettings.php);
I also added a select list field myself, directing potential customers to send me contextualized job inquiry messages only.
All of the aforementioned optional fields are HTMLForm template-engine fields.

If someone wants to remove the subject field from backend (from the PHP code by which it is hardcoded) from whatever reason, it would be a logistical pain, because, for example, after every automatic upgrade, it will have to be removed again, probably manually, from ContactPage extension relevant PHP source code (unlike all other fields which are optional from the very stable file LocalSettings.php).

My problem

I want to remove the aforementioned subject field and the only very stable ways I have with the current architecture of MediaWiki, are CSS and JS;
But this is problematic because a user can easily turn off both (most users won't do that, but still).
I want to remove the field because I have other custom fields such a select list that direct a customer to send me messages in the context of jobs only (I don't want to get any other kind of messages from surfers in that particular site).

My question

How to prevent parsing of a should-be-parsed HTML element from server (Apache)?

Is there any "nasty trick" with .htaccess, SSH or Cpanel to prevent the parsing of the should-be-parsed subject field by some criteria (say, its HTML attribute or CSS class or whatever other applicable criteria)?

  • Have you tried opening an issue on the MediaWiki page? A pull request which reads the subject line optionally in the code if its passed seems like the best solution. If there's support already for it, someone will point you in the right direction for customising it, if not, someone will write the code to do it. – Squiggs. Jan 15 '20 at 10:54
  • Hello @Squiggs. ; I did try to contact the community (via MediaWiki support desk) there and a community manager was helpless. I found no documentation on this ; A MediaWiki software engineer active in Stack Exchange - Tgr (stackoverflow.com/users/323407/tgr) admitted this is a problem and suggested me to report a bug but I don't want to register to basically any web community so I didn't do so. – user58733 Jan 15 '20 at 10:59
  • 1
    @JohnDoea Can't make any promises but I'll take a look tonight, see if I can get anywhere. – Squiggs. Jan 15 '20 at 11:08
  • So you're willing to make your IP address public forever (by using their support desk without an account), but you're not willing to register a pseudonymous account? – Joseph Sible-Reinstate Monica Jan 15 '20 at 13:34
  • @JosephSible-ReinstateMonica I replace IPs regularly... If that matters... – user58733 Jan 15 '20 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy