Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Increase readability #741

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactored the constructs
for ($i=0;$i<count($var);$i++)
to
for ($i=0, $iMax = count($var); $i< $iMax; $i++)

so we don't spend processor time counting the same variable every loop
iteration
  • Loading branch information
rotelok committed Jun 16, 2018
commit 7bc0dea2453d3ffdf1fffac8ec4a336d19b4d304
2 changes: 1 addition & 1 deletion editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<span class="heading"><?php echo $t['Last 10 files...'];?></span><br>
<ul class="fileManager" id="last10Files" style="margin-left: 0; line-height: 20px"><?php
$last10FilesArray = explode(",",$ICEcoder["last10Files"]);
for ($i=0;$i<count($last10FilesArray);$i++) {
for ($i=0, $iMax = count($last10FilesArray); $i< $iMax; $i++) {
if ($ICEcoder["last10Files"]=="") {
echo '<div style="display: inline-block; margin-left: -39px; margin-top: -4px">'.$t['none'].'</div><br><br>';
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/backup-versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}
}
sort($themeArray);
for ($i=0;$i<count($themeArray);$i++) {
for ($i=0, $iMax = count($themeArray); $i< $iMax; $i++) {
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css?microtime='.microtime(true).'">'.PHP_EOL;
}
?>
Expand Down
4 changes: 2 additions & 2 deletions lib/bug-files-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

$result = "ok";

for ($i=0; $i<count($files); $i++) {
for ($i=0, $iMax = count($files); $i< $iMax; $i++) {
// Work out the real path for a file
$files[$i] = realpath($_SERVER['DOCUMENT_ROOT'].$files[$i]);
// If we can't find that file or it doesn't start with the doc root, it's an error
Expand All @@ -26,7 +26,7 @@

$filesWithNewBugs = 0;

for ($i=0; $i<count($files); $i++) {
for ($i=0, $iMax = count($files); $i< $iMax; $i++) {
// If we have set a filesize value previously and it's different to now, there's new bugs
$fileSizesSeenArray = explode(",",xssClean($_GET['filesSizesSeen'],"html"));
if ($fileSizesSeenArray[$i]!="null" && $fileSizesSeenArray[$i] != $filesSizesSeen[$i]) {
Expand Down
16 changes: 8 additions & 8 deletions lib/file-control-xhr.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

// Make each path in $file a full path (; seperated list)
$allFiles = explode(";",$file);
for ($i=0; $i<count($allFiles); $i++) {
for ($i=0, $iMax = count($allFiles); $i< $iMax; $i++) {
if (strpos($allFiles[$i],$docRoot)===false && $_GET['action']!="getRemoteFile") {
$allFiles[$i]=str_replace("|","/",$docRoot.$iceRoot.$allFiles[$i]);
}
Expand All @@ -65,7 +65,7 @@

// Check through all files to make sure they're valid/safe
$allFiles = explode(";",$file);
for ($i=0; $i<count($allFiles); $i++) {
for ($i=0, $iMax = count($allFiles); $i< $iMax; $i++) {

// Uncomment to alert and console.log the action and file, useful for debugging
// echo ";alert('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');console.log('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');";
Expand Down Expand Up @@ -109,7 +109,7 @@ function stitchChanges($fileLines) {
$changes = json_decode($_POST['changes'],true);

// For each of those changes, handle the same requests on file on server to to match client view seen
for ($i=0; $i<count($changes); $i++) {
for ($i=0, $iMax = count($changes); $i< $iMax; $i++) {
// Replace line(s)
if ($changes[$i][0] == "replace") {
for ($j=$changes[$i][1]; $j<=$changes[$i][2]-1; $j++) { // Take 1 from end
Expand Down Expand Up @@ -272,7 +272,7 @@ function stitchChanges($fileLines) {
// Need to add a new line at the end of each because explode will lose them,
// want want to end up with same array that 'file($file)' produces for a local file
// - it keeps the line endings at the end of each array item
for ($i=0; $i<count($fileLines); $i++) {
for ($i=0, $iMax = count($fileLines); $i< $iMax; $i++) {
if ($i<count($fileLines)-1) {
$fileLines[$i] .= $ICEcoder["lineEnding"];
}
Expand Down Expand Up @@ -365,7 +365,7 @@ function stitchChanges($fileLines) {
// Make any dirs that don't exist if full path isn't there
if (!is_dir($backupDirBase.implode("/",$subDirsArray))) {
$pathIncr = "";
for ($i=0; $i<count($subDirsArray); $i++) {
for ($i=0, $iMax = count($subDirsArray); $i< $iMax; $i++) {
$pathIncr .= $subDirsArray[$i]."/";
// If this subdir isn't there, make it
if (!is_dir($backupDirBase.$pathIncr)) {
Expand Down Expand Up @@ -399,7 +399,7 @@ function stitchChanges($fileLines) {
$versionsInfoOrig = explode("\n",$versionsInfoOrig);
$replacedLine = false;
// For each line, either re-set number or simply include the line
for ($i=0; $i<count($versionsInfoOrig); $i++) {
for ($i=0, $iMax = count($versionsInfoOrig); $i< $iMax; $i++) {
if (strpos($versionsInfoOrig[$i],$fileLoc."/".$fileName." = ") === 0) {
$versionsInfo .= $fileLoc."/".$fileName." = ".$backupFileNum.PHP_EOL;
$replacedLine = true;
Expand Down Expand Up @@ -427,7 +427,7 @@ function stitchChanges($fileLines) {
for ($i=0; $i<=$ICEcoder["backupsDays"]; $i++) {
$backupDirsKeep[] = date($backupDirFormat, strtotime('-'.$i.' day',strtotime($backupDirDate)));
}
for ($i=0; $i<count($backupDirsList); $i++) {
for ($i=0, $iMax = count($backupDirsList); $i< $iMax; $i++) {
if ($backupDirsList[$i] != "." && $backupDirsList[$i] != ".." && !in_array($backupDirsList[$i],$backupDirsKeep)) {
rrmdir($backupDirBase.$backupDirHost."/".$backupDirsList[$i]);
}
Expand Down Expand Up @@ -798,7 +798,7 @@ function getDetails($fileArr) {
}
// Local
} else {
for ($i=0;$i<count($filesArray);$i++) {
for ($i=0, $iMax = count($filesArray); $i< $iMax; $i++) {
$fullPath = str_replace(array($docRoot, $iceRoot), "", $filesArray[$i]);
$fullPath = $docRoot.$iceRoot.$fullPath;

Expand Down
6 changes: 3 additions & 3 deletions lib/file-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

// Make each path in $file a full path (; seperated list)
$allFiles = explode(";",$file);
for ($i=0; $i<count($allFiles); $i++) {
for ($i=0, $iMax = count($allFiles); $i< $iMax; $i++) {
if (strpos($allFiles[$i],$docRoot)===false && $_GET['action']!="getRemoteFile") {
$allFiles[$i]=str_replace("|","/",$docRoot.$iceRoot.$allFiles[$i]);
}
Expand All @@ -44,7 +44,7 @@

// Check through all files to make sure they're valid/safe
$allFiles = explode(";",$file);
for ($i=0; $i<count($allFiles); $i++) {
for ($i=0, $iMax = count($allFiles); $i< $iMax; $i++) {

// Uncomment to alert and console.log the action and file, useful for debugging
// echo ";alert('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');console.log('".xssClean($_GET['action'],"html")." : ".$allFiles[$i]."');";
Expand All @@ -69,7 +69,7 @@
$lineNumber = max(isset($_REQUEST['lineNumber'])? (int)$_REQUEST['lineNumber'] :1, 1);
// Check this file isn't on the banned list at all
$canOpen = true;
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
for ($i=0, $iMax = count($_SESSION['bannedFiles']); $i< $iMax; $i++) {
if(str_replace("*","",$_SESSION['bannedFiles'][$i]) != "" && strpos($file,str_replace("*","",$_SESSION['bannedFiles'][$i]))!==false) {$canOpen = false;}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/ftp-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
if ($_GET['action']!="choose" && $_GET['action']!="edit") {

// Look at each of the existing FTP sites
for ($i=0; $i<count($oldFTPSites); $i++) {
for ($i=0, $iMax = count($oldFTPSites); $i< $iMax; $i++) {

// Updating
if ($_GET['action']=="update" && $i == $_GET['ftpSiteRef']) {
Expand Down Expand Up @@ -142,7 +142,7 @@
<form id="ftpUpdateForm" action="ftp-manager.php?action=update" method="POST">
<table style="width: 100%">
<?php
for ($i=0; $i<count($ftpSites); $i++) {
for ($i=0, $iMax = count($ftpSites); $i< $iMax; $i++) {
echo '<tr>';
echo '<td style="padding: 10px 10px 8px 0">'.$ftpSites[$i]['site'].'</td>';
echo '<td style="padding: 10px 10px 8px 0">'.$ftpSites[$i]['host'].'</td>';
Expand Down
8 changes: 4 additions & 4 deletions lib/get-branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'

foreach($finalArray as $entry) {
$canAdd = true;
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
for ($i=0, $iMax = count($_SESSION['bannedFiles']); $i< $iMax; $i++) {
if(str_replace("*","",$_SESSION['bannedFiles'][$i]) != "" && strpos($entry,str_replace("*","",$_SESSION['bannedFiles'][$i]))!==false) {$canAdd = false;}
}
// Only applicable for local dir, ignoring ICEcoder's dir
Expand All @@ -169,7 +169,7 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
natcasesort($filesArray);

$finalArray = array_merge($dirArray,$filesArray);
for ($i=0;$i<count($finalArray);$i++) {
for ($i=0, $iMax = count($finalArray); $i< $iMax; $i++) {
$fileFolderName = str_replace("\\","/",$finalArray[$i]);
if (!isset($ftpSite)) {
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
Expand Down Expand Up @@ -228,7 +228,7 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
$i=0;
$dirListArray = $dirSHAArray = $dirTypeArray = array();
// For each of the files in our local path...
for ($i=0; $i<count($objectListArray); $i++) {
for ($i=0, $iMax = count($objectListArray); $i< $iMax; $i++) {
$fileFolderName = "/".$objectListArray[$i];

// If we're not looking at a .git dir, it's not a .gitignore excluded path and not a dir
Expand Down Expand Up @@ -266,7 +266,7 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
$ghRemoteURL = str_replace("https://github.com/","",$ghRemoteURL);

// Reduce absolute excluded paths to relative
for ($i=0; $i<count($excluded); $i++) {
for ($i=0, $iMax = count($excluded); $i< $iMax; $i++) {
$excluded[$i] = str_replace($docRoot.$iceRoot,"",$excluded[$i]);
}
?>
Expand Down
10 changes: 5 additions & 5 deletions lib/github-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}

// Then set all the old local paths
for ($i=0; $i<count($oldLocal); $i++) {
for ($i=0, $iMax = count($oldLocal); $i< $iMax; $i++) {
$settingsNew .= '"'.$oldLocal[$i].'",';
}
// Rtrim off the last comma
Expand All @@ -97,7 +97,7 @@
}

// Then set all the old remote paths
for ($i=0; $i<count($oldRemote); $i++) {
for ($i=0, $iMax = count($oldRemote); $i< $iMax; $i++) {
$settingsNew .= '"'.$oldRemote[$i].'",';
}
// Rtrim off the last comma
Expand All @@ -116,7 +116,7 @@
$settingsNew = '"githubLocalPaths" => array(';

// Redo the arrays using the form data
for ($i=0; $i<count($oldLocal); $i++) {
for ($i=0, $iMax = count($oldLocal); $i< $iMax; $i++) {
if ($_POST['githubLocalPath'.$i] != "") {
$settingsNew .= '"'.injClean(xssClean($_POST['githubLocalPath'.$i],"html")).'",';
}
Expand All @@ -129,7 +129,7 @@
$settingsNew .= '"githubRemotePaths" => array(';

// Redo the arrays using the form data
for ($i=0; $i<count($oldRemote); $i++) {
for ($i=0, $iMax = count($oldRemote); $i< $iMax; $i++) {
if ($_POST['githubRemotePath'.$i] != "") {
$settingsNew .= '"'.injClean(xssClean($_POST['githubRemotePath'.$i],"html")).'",';
}
Expand Down Expand Up @@ -195,7 +195,7 @@
<td style="padding-left: 5px"><?php echo $t['Remote GitHub path'];?> <span class="info" title="<?php echo $t['Absolute URL beginning...'];?>">[?]</span></td>
</tr>
<?php
for ($i=0; $i<count($pathsLocal); $i++) {
for ($i=0, $iMax = count($pathsLocal); $i< $iMax; $i++) {
echo '<tr>';
echo '<td style="padding: 0 10px 8px 0"><input type="text" name="githubLocalPath'.$i.'" value="'.$pathsLocal[$i].'" style="width: 250px"></td>';
echo '<td style="padding: 0 10px 8px 0"><input type="text" name="githubRemotePath'.$i.'" value="'.$pathsRemote[$i].'" style="width: 250px"></td>';
Expand Down
2 changes: 1 addition & 1 deletion lib/github.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
$selectedFiles = xssClean($_GET['selectedFiles'],"html");
$selectedFiles = explode(";",$selectedFiles);

for ($i=0; $i<count($selectedFiles); $i++) {
for ($i=0, $iMax = count($selectedFiles); $i< $iMax; $i++) {
// Replace pipes with slashes
$file = str_replace("|","/",$selectedFiles[$i]);

Expand Down
4 changes: 2 additions & 2 deletions lib/multiple-results.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function phpGrep($q, $path, $base) {
$bFile = false;
$foundInSelFile = false;
// Exclude banned files
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
for ($i=0, $iMax = count($ICEcoder['bannedFiles']); $i< $iMax; $i++) {
if (strpos($f,str_replace("*","",$ICEcoder['bannedFiles'][$i]))!==false) {$bFile = true;}
}
// Exclude the folder ICEcoder is running from
Expand All @@ -138,7 +138,7 @@ function phpGrep($q, $path, $base) {
$bFile = true;
}
$findPath = str_replace($base,"",$fullPath);
for ($i=0;$i<count($selectedFiles);$i++) {
for ($i=0, $iMax = count($selectedFiles); $i< $iMax; $i++) {
$stringExtra = $selectedFiles[$i] != "|" ? "/" : "";
if (strpos($findPath.$stringExtra,str_replace("|","/",$selectedFiles[$i]).$stringExtra)===0) {
$foundInSelFile = true;
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if ($_SESSION['loggedIn']) {
// Work out the plugins to display to the user
$pluginsDisplay = "";
for ($i=0;$i<count($ICEcoder["plugins"]);$i++) {
for ($i=0, $iMax = count($ICEcoder["plugins"]); $i< $iMax; $i++) {
$target = explode(":",$ICEcoder["plugins"][$i][4]);
$pluginsDisplay .= '<a href="'.$ICEcoder["plugins"][$i][3].'" title="'.$ICEcoder["plugins"][$i][0].'" target="'.$target[0].'"><img src="'.$ICEcoder["plugins"][$i][1].'" style="'.$ICEcoder["plugins"][$i][2].'" alt="'.$ICEcoder["plugins"][$i][0].'"></a><br><br>';
}
Expand All @@ -20,7 +20,7 @@

// Work out what plugins we'll need to set on a setInterval
$onLoadExtras = "";
for ($i=0;$i<count($ICEcoder["plugins"]);$i++) {
for ($i=0, $iMax = count($ICEcoder["plugins"]); $i< $iMax; $i++) {
if ($ICEcoder["plugins"][$i][5]!="") {
$onLoadExtras .= ";top.ICEcoder.startPluginIntervals(".$i.",'".$ICEcoder["plugins"][$i][3]."','".$ICEcoder["plugins"][$i][4]."','".$ICEcoder["plugins"][$i][5]."')";
}
Expand Down
12 changes: 6 additions & 6 deletions lib/plugins-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
$settingsNew = '"plugins" => array(';

// Set all the old plugins
for ($i=0; $i<count($oldPlugins); $i++) {
for ($i=0, $iMax = count($oldPlugins); $i< $iMax; $i++) {
$settingsNew .= ' array("'.$oldPlugins[$i][0].'","'.$oldPlugins[$i][1].'","'.$oldPlugins[$i][2].'","'.$oldPlugins[$i][3].'","'.$oldPlugins[$i][4].'","'.$oldPlugins[$i][5].'"),';
}
// Then add the new one
Expand All @@ -83,7 +83,7 @@
$settingsNew = '"plugins" => array(';

// Set all the old plugins
for ($i=0; $i<count($oldPlugins); $i++) {
for ($i=0, $iMax = count($oldPlugins); $i< $iMax; $i++) {
// As long as it's not the one we want to remove
if ($oldPlugins[$i][0] != $pluginsData[$_GET['plugin']]['name']) {
$settingsNew .= ' array("'.$oldPlugins[$i][0].'","'.$oldPlugins[$i][1].'","'.$oldPlugins[$i][2].'","'.$oldPlugins[$i][3].'","'.$oldPlugins[$i][4].'","'.$oldPlugins[$i][5].'"),';
Expand All @@ -109,7 +109,7 @@
$settingsNew = '"plugins" => array(';

// Redo the arrays using the form data
for ($i=0; $i<count($oldPlugins); $i++) {
for ($i=0, $iMax = count($oldPlugins); $i< $iMax; $i++) {
$timer = (int)$_POST['timer' . $i];
if ($timer == 0) {
$timer = "";
Expand Down Expand Up @@ -202,7 +202,7 @@ function deletePlugin($dir) {
<td style="padding-left: 5px"><?php echo $t['Timer'];?></td>
</tr>
<?php
for ($i=0; $i<count($plugins); $i++) {
for ($i=0, $iMax = count($plugins); $i< $iMax; $i++) {
echo '<tr>';
echo '<td style="padding: 0 10px 8px 0; width: 28px; text-align: center"><img src="../'.$plugins[$i][1].'" alt="'.$plugins[$i][0].'"><input type="hidden" name="name'.$i.'" value="'.$plugins[$i][0].'"><input type="hidden" name="icon'.$i.'" value="'.$plugins[$i][1].'"><input type="hidden" name="style'.$i.'" value="'.$plugins[$i][2].'"></td>';
echo '<td style="padding: 8px 10px 8px 0; width: 250px; white-space: nowrap">'.$plugins[$i][0].'</td>';
Expand Down Expand Up @@ -233,13 +233,13 @@ function deletePlugin($dir) {
?>
<table>
<?php
for ($i=0; $i<count($pluginsData); $i++) {
for ($i=0, $iMax = count($pluginsData); $i< $iMax; $i++) {
if ($i % 2 == 0) {
echo '<tr>'.PHP_EOL;
}

$installUninstallButton = '<div style="display: inline-block; padding: 5px; background: #2187e7; color: #fff; font-size: 12px; cursor: pointer" onclick="window.location=\'plugins-manager.php?action=install&plugin='.$i.'&csrf='.$_SESSION["csrf"].'\'">'.$t['Install'].'</div>';
for ($j=0; $j<count($plugins); $j++) {
for ($j=0, $jMax = count($plugins); $j< $jMax; $j++) {
if ($pluginsData[$i]['name'] == $plugins[$j][0]) {
$installUninstallButton = '<div style="display: inline-block; padding: 5px; background: #333; color: #fff; font-size: 12px; cursor: pointer" onclick="window.location=\'plugins-manager.php?action=uninstall&plugin='.$i.'&csrf='.$_SESSION["csrf"].'\'">'.$t['Uninstall'].'</div>';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$dirList = scandir($fileName);
$dirCount = 0;
$fileCount = 0;
for ($i=0; $i<count($dirList); $i++) {
for ($i=0, $iMax = count($dirList); $i< $iMax; $i++) {
if ($dirList[$i] != "." && $dirList[$i] != "..") {
if (is_dir($fileName."/".$dirList[$i])) {
$dirCount++;
Expand Down
6 changes: 3 additions & 3 deletions lib/settings-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,21 @@ function getVersionsCount($fileLoc,$fileName) {
$backupDateDirs = scandir($backupDirBase.$backupDirHost,1);
}
// Get rid of . and .. from date dirs array
for ($i=0; $i<count($backupDateDirs); $i++) {
for ($i=0, $iMax = count($backupDateDirs); $i< $iMax; $i++) {
if ($backupDateDirs[$i] == "." || $backupDateDirs[$i] == "..") {
array_splice($backupDateDirs,$i,1);
$i--;
}
}
// Check the backup index in each dir and add up the counts from matching lines
for ($i=0; $i<count($backupDateDirs); $i++) {
for ($i=0, $iMax = count($backupDateDirs); $i< $iMax; $i++) {
$backupIndex = $backupDirBase.$backupDirHost."/".$backupDateDirs[$i]."/.versions-index";
// Have a .versions-index file? Get contents
if (file_exists($backupIndex) && is_readable($backupIndex)) {
$versionsInfo = getData($backupIndex);
$versionsInfo = explode("\n",$versionsInfo);
// For each line, check if it's our file and if so, add the count to our $count value and $dateCount array
for ($j=0; $j<count($versionsInfo); $j++) {
for ($j=0, $jMax = count($versionsInfo); $j< $jMax; $j++) {
// Replace any backslashes in $fileLoc
$fileLoc = str_replace("\\","/",$fileLoc);
// Join $fileLock and $fileName into a path and replace double slashes
Expand Down
4 changes: 2 additions & 2 deletions lib/settings-save-current-files.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$saveFiles=strClean($_GET['saveFiles']);
$saveFilesArray = explode(",",$saveFiles);
$saveFiles="";
for ($i=0;$i<count($saveFilesArray);$i++) {
for ($i=0, $iMax = count($saveFilesArray); $i< $iMax; $i++) {
$saveFilesArray[$i] = str_replace("/","|",$docRoot).$saveFilesArray[$i];
$saveFiles .= $saveFilesArray[$i].",";
}
Expand All @@ -36,7 +36,7 @@

// Update our last10Files var?
$last10FilesArray = explode(",",$ICEcoder["last10Files"]);
for ($i=0;$i<count($saveFilesArray);$i++) {
for ($i=0, $iMax = count($saveFilesArray); $i< $iMax; $i++) {
$inLast10Files = in_array($saveFilesArray[$i],$last10FilesArray);
if (!$inLast10Files && $saveFilesArray[$i] !="") {
$repPosStart = strpos($settingsContents,'last10Files" => "')+18;
Expand Down
Loading