mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
parent
a7c567d6e1
commit
ab25a18648
1 changed files with 17 additions and 5 deletions
|
@ -78,7 +78,19 @@ foreach ($scanVars as $value) {
|
|||
// all variables with _id at the end will be forced to be interger
|
||||
foreach ($scanThis as $key => $value) {
|
||||
if (preg_match('/_id$/i', $key)) {
|
||||
if (is_numeric($value)) {
|
||||
$scanThis[$key] = intval($value);
|
||||
} else {
|
||||
$json = json_decode($value);
|
||||
if (is_array($json)) {
|
||||
foreach ($json as $key => $value) {
|
||||
$json[$key] = intval($value);
|
||||
}
|
||||
$scanThis[$key] = json_encode($json);
|
||||
}else{
|
||||
$scanThis[$key] = intval($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue