Skip to content

Commit

Permalink
Don't set context to empty string by default (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
amieiro committed Oct 18, 2023
1 parent e8d5e93 commit 7c700cc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions gp-includes/things/original.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,8 @@ function( $entry ) {
foreach ( $translations->entries as $key => $entry ) {
$wpdb->queries = array();

if ( ! $entry->context ) {
$entry->context = '';
}

// Context needs to match VARCHAR(255) in the database schema.
if ( mb_strlen( $entry->context ) > 255 ) {
if ( is_string( $entry->context ) && mb_strlen( $entry->context ) > 255 ) {
$entry->context = mb_substr( $entry->context, 0, 255 );
$translations->entries[ $entry->key() ] = $entry;
}
Expand Down

0 comments on commit 7c700cc

Please sign in to comment.