mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Client-side of e7b2be606a
Unregistered server URLs are now pretty different (see the source
of the link). Part of this is because of some weird change to the
web server config, part of this is because HTTPS wildcard certs don't
work infinitely deep, part of this is because Chrome now insists
on forcing HTTPS in a variety of scenarios...
Anyway, I'd love to keep supporting the old syntax but it's not
workable, and I'm really happy to have a new one that is.
17 lines
380 B
PHP
17 lines
380 B
PHP
<?php
|
|
|
|
$host = $_REQUEST['host'] ?? '';
|
|
$roomid = $_REQUEST['roomid'] ?? '';
|
|
|
|
if (!$host) {
|
|
http_response_code(400);
|
|
die('No host specified');
|
|
}
|
|
|
|
$host = preg_replace('/-/', '=', $host);
|
|
$host = preg_replace('/\\./', '-', $host);
|
|
$host = preg_replace('/:/', '--', $host);
|
|
$host = preg_replace('/=/', '---', $host);
|
|
|
|
header('Location: https://' . $host . '.psim.us/' . $roomid);
|