This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Insert 'n Check WPMU Domain Mapping

By: simonwheatley on Oct 5th, 2012  |  syntax: Diff  |  size: 1.09 KB  |  views: 206  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git a/wp-content/plugins/wordpress-mu-domain-mapping/domain_mapping.php b/wp-content/plugins/wordpress-mu-domain-mapping/domain_mapping.php
  2. index 6beabc5..5d891ac 100755
  3. --- a/wp-content/plugins/wordpress-mu-domain-mapping/domain_mapping.php
  4. +++ b/wp-content/plugins/wordpress-mu-domain-mapping/domain_mapping.php
  5. @@ -752,7 +752,11 @@ function remote_login_js() {
  6.                         if ( !is_user_logged_in() )
  7.                                 exit;
  8.                         $key = md5( time() . mt_rand() );
  9. -                       $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->dmtablelogins} ( `id`, `user_id`, `blog_id`, `t` ) VALUES( %s, %d, %d, NOW() )", $key, $current_user->ID, $_GET[ 'blogid' ] ) );
  10. +                       $result = $wpdb->insert( $wpdb->dmtablelogins, array( 'id' => $key, 'user_id' => $current_user->ID, 'blog_id' => $_GET[ 'blogid' ]  ), array( '%s', '%d', '%d' ) );
  11. +                       if ( false === $result ) {
  12. +                               echo "// WP MU Domain Mapping Error: Cannot write login keys to database \n";
  13. +                               exit;
  14. +                       }
  15.                         $url = add_query_arg( array( 'action' => 'login', 'dm' => $hash, 'k' => $key, 't' => mt_rand() ), $_GET[ 'back' ] );
  16.                         echo "window.location = '$url'";
  17.                         exit;
clone this paste RAW Paste Data