Commit 03c6da767bf4c38b14bcd891eff4415326f48c5c
- Diff rendering mode:
- inline
- side by side
index.php
(8 / 4)
|   | |||
| 108 | 108 | // FIXME: Only do the escaping and the 2>&1 if we're not in safe mode | |
| 109 | 109 | // (otherwise it will be escaped anyway). | |
| 110 | 110 | // FIXME: Removed escapeShellCmd because it clashed with author. | |
| 111 | $oldUMask = umask(0022); | ||
| 111 | 112 | exec($gitCommand . " 2>&1", $output, $result); | |
| 113 | $umask = $oldUMask; | ||
| 112 | 114 | // FIXME: The -1 is a hack to avoid 'commit' on an unchanged repo to | |
| 113 | 115 | // fail. | |
| 114 | 116 | if ($result != 0 && $result != 1) { | |
| 115 | 117 | // FIXME: HTMLify these strings | |
| 116 | print "Error running " . $gitCommand; | ||
| 117 | print "Error message: " . join("\n", $output); | ||
| 118 | print "Error code: " . $result; | ||
| 118 | print "<h1>Error</h1>\n<pre>\n"; | ||
| 119 | print "$" . $gitCommand . "\n"; | ||
| 120 | print join("\n", $output) . "\n"; | ||
| 121 | //print "Error code: " . $result . "\n"; | ||
| 122 | print "</pre>"; | ||
| 119 | 123 | } | |
| 120 | 124 | return 1; | |
| 121 | 125 | } | |
| … | … | ||
| 255 | 255 | ||
| 256 | 256 | $commitMessage = addslashes("Deleted $wikiPage"); | |
| 257 | 257 | $author = addslashes(getAuthorForUser(getUser())); | |
| 258 | if (!git("commit --message='$commitMessage' --author='$author'")) { return; } | ||
| 258 | if (!git("commit --allow-empty --no-verify --message='$commitMessage' --author='$author'")) { return; } | ||
| 259 | 259 | if (!git("gc")) { return; } | |
| 260 | 260 | } | |
| 261 | 261 | header("Location: $wikiHome"); |

