Skip to content

json_encode( $atts, JSON_UNESCAPED_SLASHES ); not compatible with PHP 5.3.0  #13

@TronicLabs

Description

@TronicLabs

Code Snippets Version 2.0-dev

GitHub >> code-snippets/blob/2.0/includes/editor.php

in line 27 >> ERROR with PHP 5.3.0

$atts = json_encode( $atts, JSON_UNESCAPED_SLASHES )

this not compatible with PHP version < 5.4.0
temporary I have adopted this solution

    if ( $json_encode ) {
        if (version_compare(phpversion(), '5.4.0', '<')) {
            $atts = json_encode( $atts );
        }else{
            $atts = json_encode( $atts, JSON_UNESCAPED_SLASHES );   
        }       
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions