Skip to content

Commit

Permalink
Remove use of getallheaders()
Browse files Browse the repository at this point in the history
  • Loading branch information
hharchani committed Aug 7, 2016
1 parent 0499005 commit ba19a8c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/controllers/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ function show($api = null) {
"page_data" => $data
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
} else {
$header = getallheaders();
$is_ajax = isset($header["X-Ajax-Request"]) && $header["X-Ajax-Request"];
$is_ajax = isset($$_SERVER["HTTP_X_AJAX_REQUEST"]) && $$_SERVER["HTTP_X_AJAX_REQUEST"];

This comment has been minimized.

Copy link
@polybuildr

polybuildr Aug 7, 2016

Member

...........?

You're trying to find the variable with name of $_SERVER["HTTP_X_AJAX_REQUEST"] ?

Like....

<?php
$var = 5;
$a = 'var';
echo $$a; // prints 5

if ($is_ajax) {
foreach ($template_meta as $name => $meta) {
Expand Down

0 comments on commit ba19a8c

Please sign in to comment.