Support old replay search API

I completely missed that this was being used...
This commit is contained in:
Guangcong Luo 2023-11-07 20:56:33 +00:00
parent fb049bef90
commit 3a8a793478
4 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
RewriteEngine on
RewriteRule ^api(/.*)?$ http://localhost:9000/api$1 [P,L]
RewriteRule ^search\.json$ search.json.php [L,QSA]
RewriteRule ^([A-Za-z0-9-]+)$ replay.php?name=$1 [L,QSA]
RewriteRule ^([A-Za-z0-9-]+)/manage$ replay-manage.php?name=$1&manage [L,QSA]
RewriteRule ^([A-Za-z0-9-]+)\.log$ replay.log.php?name=$1 [L,QSA]

View File

@ -60,7 +60,7 @@ if ($replay['password'] ?? null) {
$replay['log'] = str_replace("\r","",$replay['log']);
if ($replay['inputlog']) {
if (@$replay['inputlog']) {
if (substr($replay['formatid'], -12) === 'randombattle' || substr($replay['formatid'], -19) === 'randomdoublesbattle' || $replay['formatid'] === 'gen7challengecup' || $replay['formatid'] === 'gen7challengecup1v1' || $replay['formatid'] === 'gen7battlefactory' || $replay['formatid'] === 'gen7bssfactory' || $replay['formatid'] === 'gen7hackmonscup' || $manage) {
// ok
} else {

View File

@ -10,7 +10,7 @@ $isPrivate = isset($_REQUEST['private']);
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
require_once '../../replays/replays.lib.php';
require_once 'replays.lib.php';
$username = $Replays->toID($username);
$isPrivateAllowed = false;