Skip to:
Content

bbPress.org

Changeset 7160


Ignore:
Timestamp:
11/06/2020 12:22:08 AM (3 years 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 trunk, for 2.7. Fixes #3398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/formatting.php

    r7121 r7160  
    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.