diff --git a/action/editcommit.php b/action/editcommit.php index 91b68a3..ac2bae9 100644 --- a/action/editcommit.php +++ b/action/editcommit.php @@ -97,6 +97,12 @@ private function isIgnored($filePath) private function commitFile($filePath, $message) { if (!$this->isIgnored($filePath)) { + $message = str_replace( + ['%user%', '%mail%', '\n'], + [$this->getAuthor(), $this->getAuthorMail(), "\n"], + $message + ); + try { $repo = $this->initRepo(); @@ -232,8 +238,8 @@ public function handleMediaDeletion(Event &$event, $param) $mediaName = $event->data['name']; $message = str_replace( - ['%media%', '%user%'], - [$mediaName, $this->getAuthor()], + ['%media%'], + [$mediaName], $this->getConf('commitMediaMsgDel') ); @@ -247,8 +253,8 @@ public function handleMediaUpload(Event &$event, $param) $mediaName = $event->data[2]; $message = str_replace( - ['%media%', '%user%'], - [$mediaName, $this->getAuthor()], + ['%media%'], + [$mediaName], $this->getConf('commitMediaMsg') ); @@ -267,6 +273,7 @@ public function handleIOWikiPageWrite(Event &$event, $param) if (!$rev) { $pagePath = $event->data[0][0]; $pageName = $event->data[2]; + $pageNs = $event->data[1]; $pageContent = $event->data[0][1]; // get the summary directly from the form input @@ -288,8 +295,8 @@ public function handleIOWikiPageWrite(Event &$event, $param) } $message = str_replace( - ['%page%', '%summary%', '%user%'], - [$pageName, $editSummary, $this->getAuthor()], + ['%page%', '%summary%', '%ns%'], + [$pageName, $editSummary, $pageNs], $msgTemplate ); diff --git a/lang/en/settings.php b/lang/en/settings.php index 1486e36..a3f7db1 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -10,10 +10,10 @@ $lang['periodicPull'] = 'Pull the remote git repository every "periodicMinutes" triggered by a http page request'; $lang['updateIndexOnPull'] = 'Update index of pages changed on pull'; $lang['periodicMinutes'] = 'Timespan (in minutes) between periodic pull requests'; -$lang['commitPageMsg'] = 'Commit message for page edits (%user%,%summary%,%page% are replaced by the corresponding values)'; -$lang['commitPageMsgDel'] = 'Commit message for deleted pages (%user%,%summary%,%page% are replaced by the corresponding values)'; -$lang['commitMediaMsg'] = 'Commit message for media files (%user%,%media% are replaced by the corresponding values)'; -$lang['commitMediaMsgDel'] = 'Commit message for deleted media files (%user%,%media% are replaced by the corresponding values)'; +$lang['commitPageMsg'] = 'Commit message for page edits (%user%,%mail%,%summary%,%page%,%ns% are replaced by the corresponding values)'; +$lang['commitPageMsgDel'] = 'Commit message for deleted pages (%user%,%mail%,%summary%,%page%,%ns% are replaced by the corresponding values)'; +$lang['commitMediaMsg'] = 'Commit message for media files (%user%,%mail%,%media% are replaced by the corresponding values)'; +$lang['commitMediaMsgDel'] = 'Commit message for deleted media files (%user%,%mail%,%media% are replaced by the corresponding values)'; $lang['repoPath'] = 'Path of the git repo(s) (e.g. the savedir ' . $GLOBALS['conf']['savedir'] . ')'; $lang['repoWorkDir'] = 'Path of the git working tree, must contain "pages" and "media" directories (e.g. the savedir ' . $GLOBALS['conf']['savedir'] . ')'; $lang['gitPath'] = 'Path to the git binary (if empty, the default "/usr/bin/git" will be used)';