summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/block.module2
-rw-r--r--modules/block/block.module2
-rw-r--r--scripts/code-style.pl7
3 files changed, 7 insertions, 4 deletions
diff --git a/modules/block.module b/modules/block.module
index 7d25fdff1..819c60231 100644
--- a/modules/block.module
+++ b/modules/block.module
@@ -26,7 +26,7 @@ function block_link($type) {
function block_admin_save($edit) {
foreach ($edit as $key=>$value) {
- db_query("UPDATE blocks SET region = '". check_input($value[region]) ."', status = '". check_input($value[status]) ."', path = '". check_input($value[path]) ."', weight = '". check_input($value[weight]) ."' WHERE name = '". check_input($key) ."'");
+ db_query("UPDATE blocks SET region = '". check_input($value["region"]) ."', status = '". check_input($value["status"]) ."', path = '". check_input($value["path"]) ."', weight = '". check_input($value["weight"]) ."' WHERE name = '". check_input($key) ."'");
}
}
diff --git a/modules/block/block.module b/modules/block/block.module
index 7d25fdff1..819c60231 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -26,7 +26,7 @@ function block_link($type) {
function block_admin_save($edit) {
foreach ($edit as $key=>$value) {
- db_query("UPDATE blocks SET region = '". check_input($value[region]) ."', status = '". check_input($value[status]) ."', path = '". check_input($value[path]) ."', weight = '". check_input($value[weight]) ."' WHERE name = '". check_input($key) ."'");
+ db_query("UPDATE blocks SET region = '". check_input($value["region"]) ."', status = '". check_input($value["status"]) ."', path = '". check_input($value["path"]) ."', weight = '". check_input($value["weight"]) ."' WHERE name = '". check_input($key) ."'");
}
}
diff --git a/scripts/code-style.pl b/scripts/code-style.pl
index 4e74f12f0..50d700543 100644
--- a/scripts/code-style.pl
+++ b/scripts/code-style.pl
@@ -121,11 +121,14 @@ while (<>) {
$msg = "missing space before '{'";
}
# there should be a space after ','
- elsif (/[,][^ ]/ && $program) {
+ elsif (/[,][^ \n\r]/ && $program) {
$msg = "missing space after ','";
}
# spaces before and after, only foreach may use $foo=>bar
- elsif (/[^ =](\+|\-|\*|==|\.=|=>|=|\|\|)[^ =>]/ && $program && !/foreach/) {
+ elsif (/[^ =|-|\+](\+|\-)[^ =>|-|\+]/ && $program && !/foreach/) {
+ $msg = "'$1' -> ' $1 '";
+ }
+ elsif (/[^ =](\*|==|\.=|=>|=|\|\|)[^ =>]/ && $program && !/foreach/) {
$msg = "'$1' -> ' $1 '";
}
# ensure $bar["foo"] and $bar[$foo] and $bar[0]