mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-08-20 10:02:05 -05:00
Support configurable URLs (#1543)
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
ini_set('max_execution_time', 60); // 1 minute
|
||||
|
||||
include '../pokemonshowdown.com/config/servers.inc.php';
|
||||
require_once __DIR__ . '/../pokemonshowdown.com/config/servers.inc.php';
|
||||
require_once __DIR__ . '/config/config.inc.php';
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
require_once('lib/css-sanitizer/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php');
|
||||
@@ -70,11 +71,11 @@ if ($curlret) {
|
||||
// Parse a stylesheet from a string
|
||||
$parser = Parser::newFromString($curlret);
|
||||
$stylesheet = $parser->parseStylesheet();
|
||||
|
||||
|
||||
// Apply sanitization to the stylehseet
|
||||
$sanitizer = StylesheetSanitizer::newDefault();
|
||||
$newStylesheet = $sanitizer->sanitize( $stylesheet );
|
||||
|
||||
|
||||
// Convert the sanitized stylesheet back to text
|
||||
$outputcss = Wikimedia\CSS\Util::stringify( $newStylesheet, [ 'minify' => true ] );
|
||||
|
||||
@@ -98,7 +99,7 @@ if ($invalidate) {
|
||||
Done: <?= htmlspecialchars($customcssuri) ?> was reloaded.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://pokemonshowdown.com/servers/<?= $server ?>">Back to server management</a>
|
||||
<a href="http://<?= $psconfig['routes']['root'] ?>/servers/<?= $server ?>">Back to server management</a>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user