WordPress MU Domain Mapping
undefined GETs (2 posts)

  1. cogmios
    Posted 3 years ago #

    in redirect_login_to_orig it requests directly the $_GET['action'] this will work but is not desired:

    a) it will trigger a php notics "Notice: Undefined index: action in /opt/htdocs/html/wp-content/mu-plugins/domain_mapping.php on line 647" for users who have php turned on to show notices
    b) it is no longer preferred to query $_GET directly but use filter_input(INPUT_GET, 'action', FILTER_SANITIZE_STRING); instead (see http://php.net/manual/en/function.filter-input.php)

    e.g. replacing it with:

    $action = filter_input(INPUT_GET,  'action', FILTER_SANITIZE_STRING);
    	if ( !get_site_option( 'dm_remote_login' ) || $action == 'logout' || isset( $_GET[ 'loggedout' ] ) ) {
    		return false;

    removes the php notice

    You could also use

    $action = filter_input(INPUT_GET, 'action', FILTER_CALLBACK, $options);

    to callback to the list of available actions

    now for the "loggedout" you could use FILTER_NULL_ON_FAILURE instead


  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    Thanks for reporting the warning :) We'll probably stick to an isset() check to clear the warning since that's what we;ve used throughout the plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress MU Domain Mapping
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic