• Resolved iagofm

    (@iagofm)


    Hello!

    First, thanks for this awesome plugin.

    I think I have found a small bug in Homepage Schema. If I set a schema that contains a single quote in a value, Scheme Scalpel escapes teh single quote and Google claims that there is a “Bad escape sequence in string”. This does not happends if I use single quotes in a value in a Post or Page or in the Global schema.

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter iagofm

    (@iagofm)

    I have found the solution but I don’t know how to send a pull request or a patch.

    The bug is in class-schema-scalpel-public.php in line 256 when replacing the single quote.

    Here is the patch to fix the bug:

    Index: trunk/public/class-schema-scalpel-public.php
    ===================================================================
    --- trunk/public/class-schema-scalpel-public.php (revisión: 3138078)
    +++ trunk/public/class-schema-scalpel-public.php (copia de trabajo)
    @@ -253,7 +253,7 @@
    if ( '/' === $path ) :
    $home_schema = $wpdb->get_results( $wpdb->prepare( "SELECT custom_schema FROM %1s WHERE schema_type = 'homepage';", $wpdb->prefix . 'scsc_custom_schemas' ), ARRAY_A );
    foreach ( $home_schema as $key => $value ) :
    - $schema = str_replace( ''', "\'", html_entity_decode( unserialize( $value['custom_schema'] ) ) );
    + $schema = str_replace( ''', "'", html_entity_decode( unserialize( $value['custom_schema'] ) ) );
    self::format_schema_html( $schema_script_html, $schema );
    endforeach;
    endif;
    • This reply was modified 7 months ago by iagofm.
    • This reply was modified 7 months ago by iagofm.
    • This reply was modified 7 months ago by iagofm.
    Plugin Author Kevin Gillispie

    (@kevingillispie)

    @iagofm Thank you for bringing this to my attention! I’ll look into it immediately.

    In the future, you should be able to make pull requests here. I’ll make sure this link can be found in release notes, website, etc. with future updates.

    And, if all else fails, sending me an email will always get my attention! ??

    Thread Starter iagofm

    (@iagofm)

    I found the github repo in parallel with your response and I have already sent you a couple of pull requests. Can you take a look @kevingillispie ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible bug in Homepage Schema’ is closed to new replies.