Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions action/editcommit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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')
);

Expand All @@ -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')
);

Expand All @@ -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
Expand All @@ -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
);

Expand Down
8 changes: 4 additions & 4 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)';
Expand Down
Loading