summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/xmlrpc.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php
index 36205fbf8..2ebe47757 100644
--- a/lib/exe/xmlrpc.php
+++ b/lib/exe/xmlrpc.php
@@ -183,6 +183,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
*/
function putPage($id, $text, $params) {
global $TEXT;
+ global $lang;
$id = cleanID($id);
$TEXT = trim($text);
@@ -199,10 +200,20 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
if(checklock($id))
return new IXR_Error(1, 'The page is currently locked');
- //spam check
+ // SPAM check
if(checkwordblock())
return new IXR_Error(1, 'Positive wordblock check');
+ // autoset summary on new pages
+ if(!page_exists($id) && empty($sum)) {
+ $sum = $lang['created'];
+ }
+
+ // autoset summary on deleted pages
+ if(page_exists($id) && empty($TEXT) && empty($sum)) {
+ $sum = $lang['deleted'];
+ }
+
lock($id);
saveWikiText($id,$TEXT,$sum,$minor);