• Resolved wmerussi

    (@wmerussi)


    I have this plugin installed in my ww.wp.xz.cn website and when I run the json_encode() it appends <!-- Really Simple SSL mixed content fixer active --> on the result, so my ajax call returns error because of the < of the beggining of the appended comment.

    How may I fix it?

    Here is the code:

    'error': function(jqXHR, status, error) {
    console.log(status);
    console.log(error);
    console.log(jqXHR.responseText);

    echo json_encode(array("bookmark" => 0));

    And it returns:

    parsererror
    SyntaxError: Unexpected token < in JSON at position 14(…)
    {"bookmark":0}<!-- Really Simple SSL mixed content fixer active -->

    https://ww.wp.xz.cn/plugins/really-simple-ssl/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Hi,

    You can remove the comment by adding a filter in your functions.php:

    /*
       Remove the comment from the output
    */
    
    function rsssl_remove_comment($html) {
      $html = str_replace("<!-- Really Simple SSL mixed content fixer active -->", "", $html);
      return $html;
    }
    add_filter("rsssl_fixer_output","rsssl_remove_comment");

    That should solve your problem.

    Thread Starter wmerussi

    (@wmerussi)

    It worked, thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘json_encode and Really Simple SSL problem’ is closed to new replies.