git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
90783a3
)
edit: root include from parent directory on subpages
author
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 11 Jul 2017 16:19:47 +0000
(18:19 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 12 Jul 2017 02:46:06 +0000
(
04:46
+0200)
edit.php
patch
|
blob
|
history
diff --git
a/edit.php
b/edit.php
index 94206bb054732b0410370b3b6bfe135f3c3bae77..12859595de865444baf29dd94a8f1eaa1b61ca57 100755
(executable)
--- a/
edit.php
+++ b/
edit.php
@@
-29,7
+29,8
@@
if (!strlen($upload)) {
exit;
}
exit;
}
-$prepend = "<?php include 'head.inc.php'; ?>\n\n";
+$rootpath = str_repeat('../', substr_count($filename, '/'));
+$prepend = "<?php include '${rootpath}head.inc.php'; ?>\n\n";
$append = "\n";
if (!file_put_contents($filename, $prepend . $upload . $append))
$append = "\n";
if (!file_put_contents($filename, $prepend . $upload . $append))