Tag: tip

  • How to get URLs in JavaScript for uploaded files in MediaWiki

    How to get URLs in JavaScript for uploaded files in MediaWiki

    Today, I was trying to remove hard-coded paths from some JS code. In my particular case, I started with a stem that looked like this: /img_auth.php/c/c9/Logo.png But MediaWiki provides different ways to configure it to serve images. The hard-coded url wouldn’t work in a wiki that had $wgHashedUploadDirectory set to false. And it wouldn’t work […]