Plugin Directory

Changeset 2618479


Ignore:
Timestamp:
10/22/2021 04:49:21 PM (4 years ago)
Author:
vberkel
Message:

WP Security Fixes to wrap IO with functions

Location:
schema-app-structured-data-for-schemaorg/tags/1.17.9
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/HunchSchema/Thing.php

    r2611195 r2618479  
    485485        if ( isset( $array ) ) {
    486486            if ( $pretty && strnatcmp( phpversion(), '5.4.0' ) >= 0 ) {
    487                 $jsonLd = json_encode( $array, JSON_PRETTY_PRINT );
     487                $jsonLd = wp_json_encode( $array, JSON_PRETTY_PRINT );
    488488            } else {
    489                 $jsonLd = json_encode( $array );
     489                $jsonLd = wp_json_encode( $array );
    490490            }
    491491
  • schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/SchemaEditor.php

    r2611195 r2618479  
    337337                    update_post_meta( sanitize_key( $_POST['Id'] ), '_HunchSchemaMarkup', sanitize_textarea_field( $_POST['Data'] ) );
    338338
    339                     print json_encode( array( 'Status' => 'Ok' ) );
     339                    print wp_json_encode( array( 'Status' => 'Ok' ) );
    340340                }
    341341                else
    342342                {
    343                     print json_encode( array( 'Status' => 'Error', 'Message' => 'Invalid JSON format' ) );
     343                    print wp_json_encode( array( 'Status' => 'Error', 'Message' => 'Invalid JSON format' ) );
    344344                }
    345345            }
     
    348348        delete_post_meta( sanitize_key ($_POST['Id'] ), '_HunchSchemaMarkup' );
    349349                               
    350                 print json_encode( array( 'Status' => 'Ok', 'Delete' => true ) );
     350                print wp_json_encode( array( 'Status' => 'Ok', 'Delete' => true ) );
    351351            }
    352352        }
    353353        else
    354354        {
    355             print json_encode( array( 'Status' => 'Error', 'Message' => 'Required parameter missing' ) );
     355            print wp_json_encode( array( 'Status' => 'Error', 'Message' => 'Required parameter missing' ) );
    356356        }
    357357
  • schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/SchemaFront.php

    r2611195 r2618479  
    166166                // First delete then set; set method only updates expiry time if transient already exists
    167167                delete_transient( $transient_id );
    168                 set_transient( $transient_id, json_encode( $request_data->{"@graph"} ), 86400 );
     168                set_transient( $transient_id, wp_json_encode( $request_data->{"@graph"} ), 86400 );
    169169
    170170                if ( ! empty( $this->Settings['Debug'] ) ) {
     
    275275                }
    276276
    277                 printf( '<script type="application/ld+json" data-schema="%s-%s-%s">%s</script>' . "\n", esc_attr( $post->ID ), esc_attr( $PostType ), esc_attr( $SchemaMarkupType ), $SchemaMarkup );
     277                printf( '<script type="application/ld+json" data-schema="%s-%s-%s">%s</script>' . "\n", esc_attr( $post->ID ), esc_attr( $PostType ), esc_attr( $SchemaMarkupType ), wp_json_encode( json_decode( $SchemaMarkup ) ) );
    278278            }
    279279        }
     
    291291                else
    292292                {
    293                     printf( '<script type="application/ld+json" data-schema="Website">%s</script>' . "\n", $SchemaMarkupWebSite );
     293                    printf( '<script type="application/ld+json" data-schema="Website">%s</script>' . "\n", wp_json_encode( json_decode( $SchemaMarkupWebSite ) ) );
    294294                }
    295295            }
     
    308308                else
    309309                {
    310                     printf( '<script type="application/ld+json" data-schema="Breadcrumb">%s</script>' . "\n", $SchemaMarkupBreadcrumb );
     310                    printf( '<script type="application/ld+json" data-schema="Breadcrumb">%s</script>' . "\n", wp_json_encode( json_decode( $SchemaMarkupBreadcrumb ) ) );
    311311                }
    312312            }
     
    319319                $JSONSchemaMarkup = reset( $JSONSchemaMarkup );
    320320
    321                 print json_encode( $JSONSchemaMarkup );
     321                print wp_json_encode( $JSONSchemaMarkup );
    322322            }
    323323            else
    324324            {
    325                 print json_encode( $JSONSchemaMarkup );
     325                print wp_json_encode( $JSONSchemaMarkup );
    326326            }
    327327        }
  • schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/SchemaServer.php

    r2611195 r2618479  
    7979
    8080                if ( $pretty && ! empty( $transient ) && version_compare( phpversion(), '5.4.0', '>=' ) ) {
    81                     $transient = json_encode( json_decode( $transient ), JSON_PRETTY_PRINT );
     81                    $transient = wp_json_encode( json_decode( $transient ), JSON_PRETTY_PRINT );
    8282                }
    8383
     
    179179                'sslverify' => false,
    180180                'headers' => array( 'Content-Type' => 'application/json' ),
    181                 'body' => json_encode( $params ),
     181                'body' => wp_json_encode( $params ),
    182182            ));
    183183
  • schema-app-structured-data-for-schemaorg/tags/1.17.9/readme.txt

    r2611195 r2618479  
    66Author URI: https://www.hunchmanifest.com
    77Author: Mark van Berkel (vberkel)
    8 Requires at least: 3.7
     8Requires at least: 4.1
    99Requires PHP: 5.4
    1010Tested up to: 5.8
Note: See TracChangeset for help on using the changeset viewer.