<?php
$r = md5(rand().microtime(TRUE));
$_POST = [
$r => 'theSubmittedUsername',
'__autocomplete_fix_' . $r => 'username'
];
foreach ($_POST as $key => $val) {
$newKey = preg_replace('~^__autocomplete_fix_~', '', $key, 1, $count);
if ($count) {
$_POST[$val] = $_POST[$newKey];
unset($_POST[$key], $_POST[$newKey]);
}
}
var_export($_POST);
- Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.28, 7.4.0 - 7.4.16, 8.0.0 - 8.0.7, 8.2.1
- array (
'username' => 'theSubmittedUsername',
)
preferences:
97.15 ms | 402 KiB | 92 Q