Skip to:
Content

bbPress.org

Changeset 7116


Ignore:
Timestamp:
08/10/2020 07:51:23 PM (3 months ago)
Author:
xknown
Message:

PHP 7.4 Compat: Replace the deprecated create_function calls with anonymous functions.

Location:
branches/0.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9/bb-admin/admin-functions.php

    r6160 r7116  
    3535
    3636    $message = "<div class='$class'>$message</div>";
    37     $message = str_replace("'", "\'", $message);
    38     $lambda = create_function( '', "echo '$message';" );
     37    $lambda = function () use ( $message ) { echo $message; };
    3938    add_action( 'bb_admin_notices', $lambda );
    4039    return $lambda;
  • branches/0.9/bb-includes/template-functions.php

    r7115 r7116  
    10091009        $user_id = bb_get_current_user_info( 'id' );
    10101010        if ( isset($topic->bozos[$user_id]) && 'all' != @$_GET['view'] )
    1011             add_filter('get_topic_deleted_posts', create_function('$a', "\$a -= {$topic->bozos[$user_id]}; return \$a;") );
     1011            add_filter('get_topic_deleted_posts', function ( $a ) use ( $topic, $user_id ) { $a -= $topic->bozos[$user_id]; return $a; } );
    10121012        if ( $deleted = get_topic_deleted_posts( $id ) ) {
    10131013            $extra = sprintf(__('+%d more'), $deleted);
  • branches/0.9/search.php

    r2378 r7116  
    88
    99if ( $q = stripslashes( $q ) ) {
    10     add_filter( 'bb_recent_search_fields',   create_function( '$f', 'return $f . ", MAX(post_time) AS post_time";' ) );
    11     add_filter( 'bb_recent_search_group_by', create_function( '', 'return "t.topic_id";' ) );
     10    add_filter( 'bb_recent_search_fields',   function( $f ) { return $f . ", MAX(post_time) AS post_time"; } );
     11    add_filter( 'bb_recent_search_group_by', function() { return "t.topic_id"; } );
    1212    $bb_query_form->BB_Query_Form( 'post', array(), array( 'order_by' => 'p.post_time', 'per_page' => 5, 'post_status' => 0, 'topic_status' => 0, 'post_text' => $q, 'forum_id', 'tag', 'topic_author', 'post_author' ), 'bb_recent_search' );
    1313    $recent = $bb_query_form->results;
Note: See TracChangeset for help on using the changeset viewer.