Skip to:
Content

bbPress.org

Changeset 7159


Ignore:
Timestamp:
11/06/2020 12:21:02 AM (3 months ago)
Author:
johnjamesjacoby
Message:

Formatting: fix output of bbp_get_time_since() in some languages.

This commit changes how the "right now" fallback is calculated to avoid trimming and type-casting a translated string value, by checking the two count values (I.E. 1 year, 1 day) for emptiness - "0, 0" will now correctly fallback to "right now".

In branches/2.6, for 2.6.6. See #3398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/common/formatting.php

    r7120 r7159  
    695695        } else {
    696696
     697            // Default count values
     698            $count  = 0;
     699            $count2 = 0;
     700
    697701            // Step one: the first chunk
    698702            for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
     
    727731                }
    728732
    729                 // No output, so happened right now
    730                 if ( ! (int) trim( $output ) ) {
     733                // Empty counts, so fallback to right now
     734                if ( empty( $count ) && empty( $count2 ) ) {
    731735                    $output = $right_now_text;
    732736                }
Note: See TracChangeset for help on using the changeset viewer.