1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

Added <?php ?> tags to settings.fragment.php and added code to remove them to build.php

This commit is contained in:
Starbeamrainbowlabs 2014-12-26 11:14:29 +00:00
parent ea2411aa67
commit 582dcc5c53
3 changed files with 115 additions and 102 deletions

View file

@ -10,8 +10,17 @@ function logstr($str, $newline = true, $showtime = true)
echo("\n");
}
function removeouterphptag($phpcode)
{
$firstindex = strpos($phpcode, "\n", strpos($phpcode, "<?php"));
$lastindex = strrpos($phpcode, "?>");
return substr($phpcode, $firstindex, $lastindex - $firstindex);
}
header("content-type: text/plain");
// Protects against users wiping the settings if run via CGI
logstr("Checking for existing build....", false);
if(file_exists("index.php"))
{
@ -28,7 +37,7 @@ logstr("Reading `core.php`...", false);
$build = file_get_contents("core.php");
logstr("done", true, false);
logstr("Reading `settings.fragment.php`...", false);
$settings = file_get_contents("settings.fragment.php");
$settings = removeouterphptag(file_get_contents("settings.fragment.php"));
logstr("done", true, false);
logstr("Building.....", false);

View file

@ -1,6 +1,7 @@
<?php
$start_time = time(true);
/*
* Pepperminty Wiki
* ================
@ -102,6 +103,7 @@ Actions:
credits - view the credits
*/
///////////////////////////////////////////////////////////////////////////////////////////////
/////////////// Do not edit below this line unless you know what you are doing! ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -1,3 +1,4 @@
<?php
/*
* Pepperminty Wiki
* ================
@ -98,3 +99,4 @@ Actions:
help - get help
credits - view the credits
*/
?>