Combine these if statements into one to reduce the cyclomatic complexity.
This commit is contained in:
parent
efb5038b20
commit
a8dd045586
@ -323,26 +323,16 @@ class Notes extends Extension {
|
|||||||
$noteText = mysql_real_escape_string(html_escape($_POST["note_text"]));
|
$noteText = mysql_real_escape_string(html_escape($_POST["note_text"]));
|
||||||
|
|
||||||
// validate parameters
|
// validate parameters
|
||||||
if(is_null($imageID) || !is_numeric($imageID))
|
if (is_null($imageID) || !is_numeric($imageID) ||
|
||||||
return;
|
is_null($noteID) || !is_numeric($noteID) ||
|
||||||
|
is_null($noteX1) || !is_numeric($noteX1) ||
|
||||||
if(is_null($noteID) || !is_numeric($noteID))
|
is_null($noteY1) || !is_numeric($noteY1) ||
|
||||||
return;
|
is_null($noteHeight) || !is_numeric($noteHeight) ||
|
||||||
|
is_null($noteWidth) || !is_numeric($noteWidth) ||
|
||||||
if(is_null($noteX1) || !is_numeric($noteX1))
|
is_null($noteText) || strlen($noteText) == 0)
|
||||||
return;
|
{
|
||||||
|
|
||||||
if(is_null($noteY1) || !is_numeric($noteY1))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(is_null($noteHeight) || !is_numeric($noteHeight))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(is_null($noteWidth) || !is_numeric($noteWidth))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(is_null($noteText) || strlen($noteText) == 0)
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
global $database;
|
global $database;
|
||||||
$database->execute("UPDATE notes ".
|
$database->execute("UPDATE notes ".
|
||||||
@ -369,11 +359,11 @@ class Notes extends Extension {
|
|||||||
$noteID = int_escape($_POST["note_id"]);
|
$noteID = int_escape($_POST["note_id"]);
|
||||||
|
|
||||||
// validate parameters
|
// validate parameters
|
||||||
if(is_null($imageID) || !is_numeric($imageID))
|
if( is_null($imageID) || !is_numeric($imageID) ||
|
||||||
return;
|
is_null($noteID) || !is_numeric($noteID))
|
||||||
|
{
|
||||||
if(is_null($noteID) || !is_numeric($noteID))
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
global $database;
|
global $database;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user