Skip to content

Commit

Permalink
Further deprecate ZM_BASE_URL. Ssee #3761
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Sep 13, 2024
1 parent 528b155 commit 0ac7434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
// Absolute URL's are unnecessary and break compatibility with reverse proxies
// define( "ZM_BASE_URL", $protocol.'://'.$_SERVER['HTTP_HOST'] );

// Use relative URL's instead
define('ZM_BASE_URL', '');

require_once('includes/functions.php');
if ( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ) {
ZM\Debug('OPTIONS Method, only doing CORS');
Expand Down Expand Up @@ -211,13 +208,13 @@
exit;
}
$view = 'none';
$redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=login';
$redirect = '?view=login';
zm_session_start();
$_SESSION['postLoginQuery'] = $_SERVER['QUERY_STRING'];
session_write_close();
} else if ( ZM_SHOW_PRIVACY && ($view != 'privacy') && ($view != 'options') && (!$request) && canEdit('System') ) {
$view = 'none';
$redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=privacy';
$redirect = '?view=privacy';
$request = null;
}

Expand Down
2 changes: 1 addition & 1 deletion web/skins/classic/js/skin.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/* We can't trust PHP_SELF on a path like /index.php/"%3E%3Cimg src=x onerror=prompt('1');%3E which
will still load index.php but will include the arbitrary payload after `.php/`. To mitigate this,
try to avoid using PHP_SELF but here I try to replace everything after '.php'. */ ?>
const thisUrl = '<?php echo ZM_BASE_URL.preg_replace('/\.php.*$/i', '.php', $_SERVER['PHP_SELF']) ?>';
const thisUrl = '<?php echo preg_replace('/\.php.*$/i', '.php', $_SERVER['PHP_SELF']) ?>';
const skinPath = '<?php echo ZM_SKIN_PATH ?>';
const serverId = <?php echo defined('ZM_SERVER_ID') ? ZM_SERVER_ID : '0' ?>;
const Servers = [];
Expand Down

0 comments on commit 0ac7434

Please sign in to comment.