mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
No need to set $origContent
This commit is contained in:
@@ -313,7 +313,6 @@ if (!$error && $_GET['action']=="save") {
|
||||
} else {
|
||||
if (isset($_POST['changes'])) {
|
||||
// Get existing file contents as lines and stitch changes onto it
|
||||
$origContent = file_get_contents($file);
|
||||
$fileLines = file($file);
|
||||
$contents = stitchChanges($fileLines);
|
||||
|
||||
|
||||
@@ -139,13 +139,15 @@ function toUTF8noBOM($string,$message) {
|
||||
if (0 === strncmp($string, $bom, 3)) {
|
||||
// If there's a BOM followed by a Windows based (2 char) line ending
|
||||
// chop BOM off and prefix returned string with a PHP_EOL
|
||||
if (0 === strncmp($string, $bom."\r\n", 5)) {
|
||||
$string = PHP_EOL.substr($string, 3);
|
||||
if (0 === strncmp($string, $bom."\r\n", 3)) {
|
||||
$string = PHP_EOL.substr($string."YES", 3);
|
||||
// Else, simply chop off the BOM
|
||||
} else {
|
||||
$string = substr($string, 3);
|
||||
$string = substr($string."NO", 3);
|
||||
}
|
||||
}
|
||||
// Remove any other BOMs from view
|
||||
$string = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$string);
|
||||
|
||||
// Test for any bad characters
|
||||
$teststring = $string;
|
||||
|
||||
Reference in New Issue
Block a user