summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHakan Sandell <sandell.hakan@gmail.com>2011-10-30 12:41:26 +0100
committerHakan Sandell <sandell.hakan@gmail.com>2011-10-30 12:41:26 +0100
commit3a68d3cc23ddbed6aed2eea5ef49c35ad3494959 (patch)
tree4857df2cb1547ba330cf664bda9882615ace0db8 /lib
parented993c3be49e5048c5a8582d94415a1e74e9ec00 (diff)
parentd5a9514cb7286254b1dcf65ba764234e199b8b7f (diff)
downloadrpg-3a68d3cc23ddbed6aed2eea5ef49c35ad3494959.tar.gz
rpg-3a68d3cc23ddbed6aed2eea5ef49c35ad3494959.tar.bz2
Merge branch 'master' of github.com:splitbrain/dokuwiki
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/xmlrpc.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php
index 8e4141d4e..e5e3298ae 100644
--- a/lib/exe/xmlrpc.php
+++ b/lib/exe/xmlrpc.php
@@ -7,7 +7,7 @@ if(isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
/**
* Increased whenever the API is changed
*/
-define('DOKU_XMLRPC_API_VERSION',5);
+define('DOKU_XMLRPC_API_VERSION', 6);
require_once(DOKU_INC.'inc/init.php');
session_write_close(); //close session
@@ -584,8 +584,12 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
// save temporary file
@unlink($ftmp);
- $buff = base64_decode($file);
- io_saveFile($ftmp, $buff);
+ if (preg_match('/^[A-Za-z0-9\+\/]*={0,2}$/', $file) === 1) {
+ // DEPRECATED: Double-decode file if it still looks like base64
+ // after first decoding (which is done by the library)
+ $file = base64_decode($file);
+ }
+ io_saveFile($ftmp, $file);
$res = media_save(array('name' => $ftmp), $id, $params['ow'], $auth, 'rename');
if (is_array($res)) {