<?php
declare(strict_types=1);
session_start();
if (empty($_SESSION['miter'])) {
header('Location: ../../index.php');
exit;
}
$user_file = '../../../user/user.xml';
if (isset($_POST["miter_bio"]) && file_exists($user_file)) {
$miter_bio_call = $_POST["miter_bio"];
$internal_errors = libxml_use_internal_errors(true);
$bio_file = simplexml_load_file($user_file);
if ($bio_file !== false) {
$nodes = $bio_file->xpath("user[@id='probe']");
if (!empty($nodes)) {
foreach ($nodes as $data) {
$data->bio = $miter_bio_call;
}
$bio_file->asXML($user_file);
}
}
libxml_clear_errors();
libxml_use_internal_errors($internal_errors);
}
header("Location: ../../index.php?u=settings");
exit;