Skip to:
Content

bbPress.org

Changeset 7110


Ignore:
Timestamp:
08/03/2020 01:20:09 PM (3 months ago)
Author:
xknown
Message:

PHP 7.4 Compat: Use square brackets and remove create_function calls.

Location:
branches/1.1
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bb-admin/export.php

    r2425 r7110  
    4646                $data .= str_repeat("\t", $tabs + 1) . "<meta key='$mk'><![CDATA[$mv]]></meta>\n";
    4747        } else {
    48             if ( '!' == $k{0} ) {
     48            if ( '!' == $k[0] ) {
    4949                $k = substr($k, 1);
    5050                $v = "<![CDATA[$v]]>";
     
    6666    $r = array();
    6767    foreach ( $translate as $prop => $export ) {
    68         if ( '?' == $export{0} ) {
     68        if ( '?' == $export[0] ) {
    6969            $export = substr($export, 1);
    7070            if ( !$data[$prop] ) {
  • branches/1.1/bb-includes/class.bb-dir-map.php

    r6153 r7110  
    7474            if ( in_array($this->_current_file, array('.', '..')) )
    7575                continue;
    76             if ( !$this->dots && '.' == $this->_current_file{0} )
     76            if ( !$this->dots && '.' == $this->_current_file[0] )
    7777                continue;
    7878
  • branches/1.1/bb-includes/functions.bb-core.php

    r6825 r7110  
    14321432        if ( $themes_dir = @dir( $_data['dir'] ) ) {
    14331433            while( ( $theme_dir = $themes_dir->read() ) !== false ) {
    1434                 if ( is_file( $_data['dir'] . $theme_dir . '/style.css' ) && is_readable( $_data['dir'] . $theme_dir . '/style.css' ) && '.' != $theme_dir{0} ) {
     1434                if ( is_file( $_data['dir'] . $theme_dir . '/style.css' ) && is_readable( $_data['dir'] . $theme_dir . '/style.css' ) && '.' != $theme_dir[0] ) {
    14351435                    $r[$_name . '#' . $theme_dir] = $_name . '#' . $theme_dir;
    14361436                }
  • branches/1.1/bb-includes/functions.bb-deprecated.php

    r6208 r7110  
    552552function bb_convert_path_base( $path, $from_base, $to_base ) {
    553553    bb_log_deprecated('function', __FUNCTION__, 'no alternative');
    554     $last_char = $path{strlen($path)-1};
     554    $last_char = $path[strlen($path)-1];
    555555    if ( '/' != $last_char && '\\' != $last_char )
    556556        $last_char = '';
  • branches/1.1/bb-includes/functions.bb-template.php

    r6156 r7110  
    32583258
    32593259    foreach ( (array) $tags as $tag ) {
    3260         $counts{$tag->raw_tag} = $tag->tag_count;
    3261         $taglinks{$tag->raw_tag} = bb_get_tag_link( $tag );
     3260        $counts[$tag->raw_tag] = $tag->tag_count;
     3261        $taglinks[$tag->raw_tag] = bb_get_tag_link( $tag );
    32623262    }
    32633263
     
    32763276
    32773277    foreach ( $counts as $tag => $count ) {
    3278         $taglink = esc_attr($taglinks{$tag});
     3278        $taglink = esc_attr($taglinks[$tag]);
    32793279        $tag = str_replace(' ', '&nbsp;', esc_html( $tag ));
    32803280        $fontsize = round( $smallest + ( ( $count - $min_count ) * $fontstep ), 1 );
  • branches/1.1/topic.php

    r2147 r7110  
    1515
    1616if ( $view_deleted ) {
    17     add_filter('get_thread_where', create_function('', 'return "p.topic_id = ' . $topic_id . '";'));
    18     add_filter('get_thread_post_ids', create_function('', 'return "p.topic_id = ' . $topic_id . '";'));
     17    add_filter('get_thread_where', function() use ($topic_id) { return "p.topic_id = " . intval( $topic_id ); });
     18    add_filter('get_thread_post_ids', function() use ($topic_id) { return "p.topic_id = " . intval( $topic_id ); });
    1919    add_filter('post_edit_uri', 'bb_make_link_view_all');
    2020}
Note: See TracChangeset for help on using the changeset viewer.