Commit 22833af1 authored by Mindiell's avatar Mindiell

Suppression de l'attaque directe des retours de fonction, non utilisable en php < 5.4

parent c6ab97d0
......@@ -8,7 +8,8 @@ class Main extends Controller {
function home($f3,$args) {
// Select a random contact
$rand_id = rand(0, count($f3->get('contacts'))-1);
$f3->set('contact', $f3->get('contacts')[$rand_id]);
$contacts = $f3->get('contacts');
$f3->set('contact', $contacts[$rand_id]);
$f3->set('block_content','home.html');
}
......@@ -21,8 +22,8 @@ class Main extends Controller {
function feedbackform($f3, $args) {
//GET
if ($f3->get('VERB') == 'GET'){
$categories = Api::get_feedback_categories()['categories'];
$f3->set('feedback_categories', $categories);
$categories = Api::get_feedback_categories();
$f3->set('feedback_categories', $categories['categories']);
$contact_id = $f3->get('POST.contact_id');
$f3->set("contact_id", $contact_id);
......@@ -73,7 +74,8 @@ class Main extends Controller {
}
function contactslist($f3, $args) {
$f3->set('contacts', Api::get_contacts()['contacts']);
$contacts = Api::get_contacts();
$f3->set('contacts', $contacts);
$f3->set('block_content', 'contactslist.html');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment