Added <?php ?> tags to and added code to remove them to

This commit is contained in:
Starbeamrainbowlabs 2014-12-26 11:14:29 +00:00 committed by Starbeamrainbowlabs
parent ea2411aa67
commit 646591fa90
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 removeouterphptags($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 = removeouterphptags(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
*/
?>