Skip to content

Commit

Permalink
Support old replay search API
Browse files Browse the repository at this point in the history
I completely missed that this was being used...
  • Loading branch information
Zarel committed Nov 7, 2023
1 parent fb049be commit 3a8a793
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions replay.pokemonshowdown.com/.htaccess
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion replay.pokemonshowdown.com/replay.log.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

$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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
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;
Expand Down
File renamed without changes.

0 comments on commit 3a8a793

Please sign in to comment.