Please use x() correctly:

<?php
if (x($someArray, 'element')) {
	// Do something
}
?>

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-03-30 21:36:34 +02:00
parent 3d595c4dcc
commit 5bc2ebb267
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
3 changed files with 38 additions and 33 deletions

View file

@ -2022,14 +2022,14 @@ function admin_page_features_post(App $a) {
$feature_state = 'feature_' . $feature;
$featurelock = 'featurelock_' . $feature;
if (x($_POST[$feature_state])) {
$val = intval($_POST['feature_'.$feature]);
if (x($_POST, $feature_state)) {
$val = intval($_POST[$feature_state]);
} else {
$val = 0;
}
set_config('feature',$feature,$val);
if (x($_POST[$featurelock])) {
if (x($_POST, $featurelock)) {
set_config('feature_lock', $feature, $val);
} else {
del_config('feature_lock', $feature);

View file

@ -6,7 +6,7 @@ function network_init(App $a) {
}
$is_a_date_query = false;
if (x($_GET['cid']) && intval($_GET['cid']) != 0) {
if (x($_GET, 'cid') && intval($_GET['cid']) != 0) {
$cid = $_GET['cid'];
}
@ -103,20 +103,23 @@ function network_init(App $a) {
}
}
if(x($_GET['nets']) && $_GET['nets'] === 'all')
// If nets is set to all, unset it
if (x($_GET, 'nets') && $_GET['nets'] === 'all') {
unset($_GET['nets']);
}
$group_id = (($a->argc > 1 && is_numeric($a->argv[1])) ? intval($a->argv[1]) : 0);
set_pconfig(local_user(), 'network.view', 'group.selected', $group_id);
require_once('include/group.php');
require_once('include/contact_widgets.php');
require_once('include/items.php');
require_once('include/ForumManager.php');
require_once 'include/group.php';
require_once 'include/contact_widgets.php';
require_once 'include/items.php';
require_once 'include/ForumManager.php';
if(! x($a->page,'aside'))
if (! x($a->page, 'aside')) {
$a->page['aside'] = '';
}
$search = ((x($_GET, 'search')) ? escape_tags($_GET['search']) : '');
@ -157,8 +160,9 @@ function network_init(App $a) {
function saved_searches($search) {
if(! feature_enabled(local_user(),'savedsearch'))
if (! feature_enabled(local_user(),'savedsearch')) {
return '';
}
$a = get_app();

View file

@ -213,8 +213,9 @@ function vier_community_info() {
require_once('include/ForumManager.php');
if (x($_GET['cid']) && intval($_GET['cid']) != 0)
if (x($_GET, 'cid') && intval($_GET['cid']) != 0) {
$cid = $_GET['cid'];
}
//sort by last updated item
$lastitem = true;