I tried the patch above, but that did not quite fix the same issue, so I downloaded the newer contents of MagicWord.php file from the right side of
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/122449/1/includes/MagicWord.php#686
as given by @blacksunshineCoding above, uploaded it to overwrite my MagicWord.php (after first saving a copy) and that fixed the issue.
Unfortunately the subsequent purge broke my session and even after various attempts (cookies, adding cache settings to LocalSettings.php) I can't log in with this browser due to "There seems to be a problem with your login session; this action has been canceled as a precaution against session hijacking. Go back to the previous page, reload that page and then try again." but I can see my wiki media site again with all browsers even though my MediaWiki is very very old, and I can log in and change it with other browsers.
If you have this issue, I recommend doing the purge with a browser you don't use.