git message is shellargescaped, the current edit-summary is used to create the git...
authorWolfgang Gassler <wolfgang@gassler.org>
Sun, 11 Nov 2012 12:46:42 +0000 (13:46 +0100)
committerWolfgang Gassler <wolfgang@gassler.org>
Sun, 11 Nov 2012 12:46:42 +0000 (13:46 +0100)
action/editcommit.php
lib/Git.php

index 17263c2..053b2db 100644 (file)
@@ -95,12 +95,13 @@ class action_plugin_gitbacked_editcommit extends DokuWiki_Action_Plugin {
                        $pageName = $event->data[2];
                        $pageContent = $event->data[0][1];
 
-                       $editSummary = $GLOBALS['INFO']['meta']['last_change']['sum'];
-                       
+                       // get the summary directly from the form input
+                       // as the metadata hasn't updated yer
+                       $editSummary = $GLOBALS['INPUT']->str('summary');               
 
-                       //empty content indicates a page deletion
+                       // empty content indicates a page deletion
                        if ($pageContent == '') {
-                               //get the commit text for deletions
+                               // get the commit text for deletions
                                $msgTemplate = $this->getConf('commitPageMsgDel');
 
                                // bad hack as DokuWiki deletes the file after this event
index d704f82..0d0dd96 100644 (file)
@@ -257,7 +257,7 @@ class GitRepo {
         * @return  string
         */
        public function commit($message = "") {
-               return $this->run("commit -av -m \"$message\"");
+               return $this->run("commit -av -m ".escapeshellarg($message));
        }
 
        /**