Index: branches/unlabeled/unlabeled-1.11.4/globals.php
===================================================================
diff -u -r213 -r252
--- branches/unlabeled/unlabeled-1.11.4/globals.php (.../globals.php) (revision 213)
+++ branches/unlabeled/unlabeled-1.11.4/globals.php (.../globals.php) (revision 252)
@@ -42,7 +42,13 @@
$retval = array();
$section = '';
+ $ln = 1;
+ $resave = false;
foreach($contents as $line) {
+ if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
+ $resave = true;
+ }
+ $ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
@@ -67,7 +73,14 @@
//echo '
';
} //end if
} //end foreach
-
+ if ($resave) {
+ $fp = fopen($file, "w");
+ reset($contents);
+ fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
+ foreach($contents as $line) fwrite($fp,"$line");
+ fclose($fp);
+ }
+
return $retval;
}
Index: branches/unlabeled/unlabeled-1.9.4/admin/install/install_lib.php
===================================================================
diff -u -r186 -r252
--- branches/unlabeled/unlabeled-1.9.4/admin/install/install_lib.php (.../install_lib.php) (revision 186)
+++ branches/unlabeled/unlabeled-1.9.4/admin/install/install_lib.php (.../install_lib.php) (revision 252)
@@ -73,6 +73,7 @@
//if( file_exists($ini_file) )
//{
$fp = fopen($ini_file, "w");
+ fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($ini_vars as $secname => $section)
{
fwrite($fp,"[".$secname."]\n");
@@ -452,7 +453,13 @@
$retval = array();
$section = '';
+ $ln = 1;
+ $resave = false;
foreach($contents as $line) {
+ if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
+ $resave = true;
+ }
+ $ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
@@ -477,7 +484,14 @@
//echo '
';
} //end if
} //end foreach
-
+ if ($resave) {
+ $fp = fopen($file, "w");
+ reset($contents);
+ fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
+ foreach($contents as $line) fwrite($fp,"$line");
+ fclose($fp);
+ }
+
return $retval;
}