(CE-1184) Apply MediaWiki 1.19.23 security patches

Cherry picking security-related patches from preview branch reviewed in https://github.com/Wikia/app/pull/5822