Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 14, 2023. It is now read-only.
/ICEcoderPublic archive

Commit39388dd

Browse files
author
mattpass
committed
array_splice, numPlugins to avoid extending loop cond, use i in array, exit dont die with msg
1 parentf544603 commit39388dd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

‎lib/plugins-manager.php‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,11 @@
7474
// ============
7575
// UNINSTALLING
7676
// ============
77-
7877
if ("uninstall" ===$_GET['action']) {
7978
// Remove the old plugin
8079
for ($i =0;$i <count($ICEcoder["plugins"]);$i++) {
8180
if ($ICEcoder["plugins"][$i][0] ===$pluginsData[$_GET['plugin']]['name']) {
82-
unset($ICEcoder["plugins"][$i]);
81+
array_splice($ICEcoder["plugins"],$i,1);
8382
}
8483
}
8584

@@ -95,12 +94,13 @@
9594

9695
if ("update" ===$_GET['action']) {
9796
// Redo the arrays using the form data
98-
for ($i =0;$i <count($ICEcoder["plugins"]);$i++) {
97+
$numPlugins =count($ICEcoder["plugins"]);
98+
for ($i =0;$i <$numPlugins;$i++) {
9999
$timer =intval($_POST['timer' .$i]);
100-
if ($timer ==0) {
100+
if (0 ===$timer) {
101101
$timer ="";
102102
}
103-
$ICEcoder["plugins"][] = [
103+
$ICEcoder["plugins"][$i] = [
104104
$_POST['name' .$i],
105105
$_POST['icon' .$i],
106106
$_POST['style' .$i],
@@ -120,7 +120,8 @@
120120
header("Location: plugins-manager.php?updatedPlugins&csrf=" .$_SESSION["csrf"]);
121121
echo"<script>window.location = 'plugins-manager.php?updatedPlugins&csrf=' + ICEcoder.csrf;</script>";
122122
}
123-
die("<span style='color: #fff'>" .$t['saving plugins'] ."</span>");
123+
exit;
124+
// die("<span style='color: #fff'>" . $t['saving plugins'] . "</span>");
124125
}else {
125126
echo"<script>parent.ICEcoder.message('" .$t['Cannot update config...'] ." data/" .$settingsFile ."" .$t['and try again'] ."');</script>";
126127
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp