Skip to content

Commit

Permalink
Replace create_function() calls by closures
Browse files Browse the repository at this point in the history
The function has been deprecated in PHP 7.2.

Fixes #284
  • Loading branch information
dregad committed Aug 30, 2018
1 parent db6c7df commit 8d26c64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Source.FilterAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ function Source_Process_FilterOption( $key, $option ) {
}

$wc = array_map( 'db_param', $value );
$wc = array_map( create_function( '$item','return "' . $key . ' LIKE $item";' ), $wc );
$value = array_map( create_function( '$item', 'return "%$item%";' ), $value );
$wc = array_map( function ( $item ) use ( $key ) { return "$key LIKE $item"; }, $wc);
$value = array_map( function( $item ) { return "%$item%"; }, $value );

$sql = '(' . implode( ' OR ', $wc ) . ')';

Expand Down Expand Up @@ -586,7 +586,7 @@ function Source_Date_StampArray( $t_input ) {
return null;
}

return array_map( create_function( '$in', 'return (int) $in;' ), array_slice( $t_matches, 1, 3 ) );
return array_map( function ( $in ) { return (int) $in; }, array_slice( $t_matches, 1, 3 ) );
}

function Source_Date_Select( $p_name, $p_selected=null ) {
Expand Down

0 comments on commit 8d26c64

Please sign in to comment.