• Hi guys,

    when I try to encode a url with urlencode wich was given by the content parameter of a shortcode, than it get’s encoded wrong. Here’s the code:

    function OEreturnData($atts,$content=null){
    extract(shortcode_atts(array(
    'maxwidth' => 500,
    'maxheight' => 281,
    ), $atts));
    var_dump(urlencode($content));
    }

    add_shortcode('shortcode_name', 'OEreturnData');

    And for example with this value

    [shortcode_name]https://herthabsc.de/index.php?id=3631&tx_ttnews[tt_news]=13144&cHash=9ef2e9ee006fb16188ebf764232a0ba9[/shortcode_name]

    I get the return of

    http%3A%2F%2Fherthabsc.de%2Findex.php%3Fid%3D3631%26%23038%3Btx_ttnews%5Btt_news%5D%3D13144%26%23038%3BcHash%3D9ef2e9ee006fb16188ebf764232a0ba9

    But it actually should be

    http%3A%2F%2Fherthabsc.de%2Findex.php%3Fid%3D3631%26tx_ttnews%5Btt_news%5D%3D13144%26cHash%3D9ef2e9ee006fb16188ebf764232a0ba9%20%20

    What’s the problem?

  • The topic ‘urlencode from shortcode?’ is closed to new replies.