Hi,
I have found why it does like these :
It is a normal $_POST treatment with some characters !
It tested the following (link to php.net:
http://www.php.net/manual/en/language.variables.external.php#94607)
<?php
// Function to fix up PHP's messing up POST input containing dots, etc.
function getRealPOST() {
$pairs = explode("&", file_get_contents("php://input"));
$vars = array();
foreach ($pairs as $pair) {
$nv = explode("=", $pair);
$name = urldecode($nv[0]);
$value = urldecode($nv[1]);
$vars[$name] = $value;
}
return $vars;
}
?>
So if I put these inside my testing snippet I have :
<?php
if (!$_POST || empty($_POST['linkField']))
{
echo '<form method="post" action="[~[*id*]~]" id="bugInPostDatas">
<fieldset>
<label for="linkField">HTML Link with MODx Syntax like this: [~docid~]</label><br />
<input type="text" id="linkField" name="linkField" value="" />
</fieldset>
<fieldset>
<input type="submit" name="submit" value="Send" />
</fieldset>
</form>';
}
else if ($_POST && !empty($_POST['linkField']))
{
var_dump(htmlentities($_POST['linkField']));
$vars = getRealPOST();
var_dump($vars);
}
function getRealPOST() {
$pairs = explode("&", file_get_contents("php://input"));
$vars = array();
foreach ($pairs as $pair) {
$nv = explode("=", $pair);
$name = urldecode($nv[0]);
$value = urldecode($nv[1]);
$vars[$name] = $value;
}
return $vars;
}
Which gives with the same data input as before:
string(44) "<a href="">contact</a>" array(2) { ["linkField"]=> string(27) "<a href="contact">contact</a>" ["submit"]=> string(4) "Send" }
So it is working well, I just need to get real posted datas from the php://input stream.