Skip to content
Snippets Groups Projects
Commit a6a229ce authored by Michael Klier's avatar Michael Klier
Browse files

XMLRPC: putPage() autoset summary on created/deleted pages if no summary was given

darcs-hash:20080304214919-23886-2e443173de79d2d6a4b8fa2ed253c15a64c13a4a.gz
parent fbf2d7bc
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment