Skip to content
Snippets Groups Projects
Commit ac50e1a4 authored by Kjartan Mannes's avatar Kjartan Mannes
Browse files

code-style.pl

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

update.php / block.module
- cleaned up coding style, and trailing spaces.
parent 0db3df1b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment