Ticket #14629: blogger-importer.diff
File blogger-importer.diff, 1.2 KB (added by , 14 years ago) |
---|
-
blogger-importer.php
old new 96 96 97 97 function auth() { 98 98 // We have a single-use token that must be upgraded to a session token. 99 $token = preg_replace( '/[^-_0-9a-zA-Z]/', '', $_GET['token']);99 $token = urldecode( preg_replace( '/[^%-_0-9a-zA-Z]/', '', $_GET['token'] ) ); 100 100 $headers = array( 101 101 "GET /accounts/AuthSubSessionToken HTTP/1.0", 102 102 "Authorization: AuthSub token=\"$token\"" … … 105 105 $sock = $this->_get_auth_sock( ); 106 106 if ( ! $sock ) return false; 107 107 $response = $this->_txrx( $sock, $request ); 108 preg_match( '/token=([ -_0-9a-z]+)/i', $response, $matches );108 preg_match( '/token=([%-_0-9a-z]+)/i', $response, $matches ); 109 109 if ( empty( $matches[1] ) ) { 110 110 $this->uh_oh( 111 111 __( 'Authorization failed' , 'blogger-importer'), … … 114 114 ); 115 115 return false; 116 116 } 117 $this->token = $matches[1];117 $this->token = urldecode( $matches[1] ); 118 118 119 119 wp_redirect( remove_query_arg( array( 'token', 'noheader' ) ) ); 120 120 }