Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ function maybe_output_site_tab() {
* @param array $messages Messages to display
*/
function output_page_header( $id, $messages = array() ) {
global $title, $parent_file, $submenu_file, $pagenow;

$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
$title_site_url_linked = sprintf( __('Aliases: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );

// Load the page header
global $title, $parent_file, $submenu_file;
$title = sprintf( __( 'Aliases: %s', 'mercator' ), $site_url_no_http );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
Expand Down Expand Up @@ -154,6 +155,8 @@ function output_page_footer() {
* @param string $action Action to perform
*/
function handle_list_page_submit( $id, $action ) {
global $parent_file;

check_admin_referer( 'mercator-aliases-bulk-' . $id );

$sendback = remove_query_arg( array( 'did_action', 'mappings', '_wpnonce' ), wp_get_referer() );
Expand Down
4 changes: 2 additions & 2 deletions class-mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public static function create( $site, $domain, $active = false ) {
}
if ( ! empty( $existing ) ) {
// Domain exists already...
if ( $site !== $mapping->get_site_id() ) {
if ( $site !== $existing->get_site_id() ) {
// ...and points to another site
return new \WP_Error( 'mercator.mapping.domain_exists' );
}
Expand All @@ -390,7 +390,7 @@ public static function create( $site, $domain, $active = false ) {
// Check that the table exists...
if ( check_table() === 'created' ) {
// Table created, try again
return static::create( $site, $domain );
return static::create( $site, $domain, $active );
}

// Other error. We suppressed errors before, so we need to make sure
Expand Down