Making WordPress.org


Ignore:
Timestamp:
08/10/2023 10:38:57 AM (3 years ago)
Author:
amieiro
Message:

Translate: Check if the object exists in the update_external_translations method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/inc/routes/class-translation-memory.php

    r12751 r12829  
    489489        public function update_external_translations( $translation ) {
    490490                $is_source_set    = isset( $_POST['externalTranslationSource'] ) && isset( $_POST['externalTranslationUsed'] );
    491                 $is_request_valid = 'GP_Route_Translation' === GP::$current_route->class_name && 'translations_post' === GP::$current_route->last_method_called;
     491                $is_request_valid = is_object( GP::$current_route ) && 'GP_Route_Translation' === GP::$current_route->class_name && 'translations_post' === GP::$current_route->last_method_called;
    492492                if ( ! $is_request_valid || ! $is_source_set || ! $translation ) {
    493493                        return;
Note: See TracChangeset for help on using the changeset viewer.