fix0red mw.newMediaObject, added byte-length logging (in which we learn Ecto 1.1.8 sends too many bytes, it seems)
git-svn-id: http://svn.automattic.com/wordpress/trunk@1569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
17d6d76c73
commit
3f32823b55
10
xmlrpc.php
10
xmlrpc.php
|
@ -740,6 +740,8 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
$file_realpath = get_settings('fileupload_realpath');
|
$file_realpath = get_settings('fileupload_realpath');
|
||||||
$file_url = get_settings('fileupload_url');
|
$file_url = get_settings('fileupload_url');
|
||||||
|
|
||||||
|
logIO('O', '(MW) Received '.strlen($bits).' bytes');
|
||||||
|
|
||||||
if (!$this->login_pass_ok($user_login, $user_pass)) {
|
if (!$this->login_pass_ok($user_login, $user_pass)) {
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
@ -753,10 +755,10 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(get_settings('fileupload_minlevel') > $userlevel) {
|
if(get_settings('fileupload_minlevel') > $user_data->user_level) {
|
||||||
// User has not enough privileges
|
// User has not enough privileges
|
||||||
logIO('O', '(MW) Not enough privilege: user level too low');
|
logIO('O', '(MW) Not enough privilege: user level too low');
|
||||||
$this->error = new IXR_Error(401, 'You are not allowed to upload files to this site.');
|
$this->error = new IXR_Error(401, 'You are not allowed to upload files to this site.sdff'.$user_data->user_level);
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,7 +771,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
$prefix = '/';
|
$prefix = '/';
|
||||||
|
|
||||||
if(!strlen(trim($name))) {
|
if(!empty($name)) {
|
||||||
// Create the path
|
// Create the path
|
||||||
$localpath = $file_realpath.$prefix.$name;
|
$localpath = $file_realpath.$prefix.$name;
|
||||||
$url = $file_url.$prefix.$name;
|
$url = $file_url.$prefix.$name;
|
||||||
|
@ -780,7 +782,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
fclose($ifp);
|
fclose($ifp);
|
||||||
@chmod($localpath, 0666);
|
@chmod($localpath, 0666);
|
||||||
|
|
||||||
if( $success ) {
|
if($success) {
|
||||||
$resp = array($url);
|
$resp = array($url);
|
||||||
return $resp;
|
return $resp;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue