Skip to content

Commit c335363

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 64fd31f + f614998 commit c335363

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

filters/fetchnodelist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ function setParameters( $parm_array )
3737

3838
// Store values of optional parameters
3939
$this->limit = isset( $parm_array[ 'limit' ] ) ? intval( $parm_array[ 'limit' ] ) : -1;
40-
$this->offset = intval( $parm_array[ 'offset' ] );
41-
$this->depth = intval( $parm_array[ 'depth' ] );
40+
$this->offset = isset( $parm_array[ 'offset' ] ) ? intval( $parm_array[ 'offset' ] ) : 0;
41+
$this->depth = isset( $parm_array[ 'depth' ] ) ? intval( $parm_array[ 'depth' ] ) : 1;
4242
if ( $this->depth == 0 )
4343
$this->depth = 1;
4444
$this->ignore_visibility = isset( $parm_array[ 'ignore_visibility' ] ) ? true : false;

operations/nodealwaysavailable.php

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,25 @@ function getHelpText()
1414

1515
function setParameters( $parm_array )
1616
{
17-
$this->available = ( $parm_array[ 'available' ] == 'true' ) ? 1 : -1;
18-
if ( $parm_array[ 'available' ] == 'false' )
19-
$this->available = 0;
20-
if ( $this->available == -1 )
21-
return 'Missing or illegal availability value';
17+
if( !isset( $parm_array[ 'available' ] ) )
18+
{
19+
return 'Missing availability value';
20+
}
21+
22+
switch( $parm_array[ 'available' ] )
23+
{
24+
case 'true':
25+
$this->available = 1;
26+
break;
27+
28+
case 'false':
29+
$this->available = 0;
30+
break;
31+
32+
default:
33+
return 'Illegal availability value';
34+
}
35+
2236
return true;
2337
}
2438

0 commit comments

Comments
 (0)