From 51597811fb665e459be288068ab39bb691bf6de1 Mon Sep 17 00:00:00 2001
From: Michael Klier <chi@chimeric.de>
Date: Tue, 4 Mar 2008 22:56:19 +0100
Subject: [PATCH] XMLRPC: putPage() throw IXR_ERROR when attempting to save a
 empty new page

darcs-hash:20080304215619-23886-14f495ef056aa44d6cf17a04c73822ea1a4f9961.gz
---
 lib/exe/xmlrpc.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php
index 2ebe47757..64c85be05 100644
--- a/lib/exe/xmlrpc.php
+++ b/lib/exe/xmlrpc.php
@@ -193,6 +193,10 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
         if(empty($id))
             return new IXR_Error(1, 'Empty page ID');
 
+        if(!page_exists($id) && empty($TEXT)) {
+            return new IXR_ERROR(1, 'Refusing to write an empty new wiki page');
+        }
+
         if(auth_quickaclcheck($id) < AUTH_WRITE)
             return new IXR_Error(1, 'You are not allowed to edit this page');
 
-- 
GitLab