0

This is my code and when running from my program it keeps replacing the . with _

<?php

if(!isset($_GET["fig"]) || empty($_GET["fig"])) {
    echo "No fig request";
    exit;
}

$ch = curl_init("https://www.habbo.com.br/habbo-imaging/avatarimage?hb=img&figure={$_GET["fig"]}&action=wav&direction=2&head_direction=3&size=m");

curl_setopt_array($ch, array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => false,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING       => "",
    CURLOPT_USERAGENT      => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
    CURLOPT_AUTOREFERER    => true,
    CURLOPT_SSL_VERIFYPEER => false
));

$content = curl_exec($ch);
$type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

curl_close($ch);

if(!isset($content) || empty($content) || strpos($content, 'Not Found') !== false) {
    echo "Not found!";
    exit;
}

header("Content-Type: {$type}");

echo $content;
?>

I've tried doing this

$figure = str_replace('_', '.', $_GET["fig"]);
$ch = curl_init("https://www.habbo.com.br/habbo-imaging/avatarimage?hb=img&figure={$figure}&action=wav&direction=2&head_direction=3&size=m");

But it just doesn't seem to want to fix the issue that I'm having and I can't seem to figure out why so if anyone would be able to help me fix this it would be greatly appreciated

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • Where is the `.` being replaced with `_`??? You haven't shown what it contains or how you see the change or anything. – AbraCadaver Jan 11 '17 at 22:54
  • Does this http://stackoverflow.com/questions/68651/get-php-to-stop-replacing-characters-in-get-or-post-arrays?rq=1 answer your question? – data cosmos Jan 11 '17 at 23:02
  • In my emulator it runs this, fig/" + Session.GetHabbo().Look + " because I have a rewrite rule to turn it into .png although somehow while its getting it, its converting all the . to _ therefore making the image not show – George Good Jan 11 '17 at 23:03
  • @datacosmos That question is about `.` being replaced in the names of parameters. This questions seems to be about the values, not names. – Barmar Jan 11 '17 at 23:27

0 Answers0