Commit ac50e1a4 authored by Kjartan's avatar Kjartan
Browse files

code-style.pl

- allow $var++ and $var-- syntax.

update.php / block.module
- cleaned up coding style, and trailing spaces.
parent 0db3df1b
......@@ -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) ."'");
}
}
......
......@@ -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) ."'");
}
}
......
......@@ -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]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment