$bl_post = intval(PConfig::get(local_user(), 'blogger', 'post'));
- $bl_enable = (($bl_post && x($_REQUEST, 'blogger_enable')) ? intval($_REQUEST['blogger_enable']) : 0);
+ $bl_enable = (($bl_post && !empty($_REQUEST['blogger_enable'])) ? intval($_REQUEST['blogger_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(), 'blogger', 'post_by_default'))) {
$bl_enable = 1;
function buffer_addon_admin_post(App $a)
{
- $client_id = ((!empty($_POST['client_id'])) ? Strings::escapeTags(trim($_POST['client_id'])) : '');
- $client_secret = ((!empty($_POST['client_secret'])) ? Strings::escapeTags(trim($_POST['client_secret'])) : '');
+ $client_id = (!empty($_POST['client_id']) ? Strings::escapeTags(trim($_POST['client_id'])) : '');
+ $client_secret = (!empty($_POST['client_secret']) ? Strings::escapeTags(trim($_POST['client_secret'])) : '');
Config::set('buffer', 'client_id' , $client_id);
Config::set('buffer', 'client_secret', $client_secret);
$rpt = PConfig::get(local_user(), 'curweather', 'curweather_loc');
// Set the language to the browsers language or default and use metric units
- $lang = (!empty($_SESSION['language']) ? $_SESSION['language'] : Config::get('system', 'language'));
+ $lang = defaults($_SESSION, 'language', Config::get('system', 'language'));
$units = PConfig::get( local_user(), 'curweather', 'curweather_units');
$appid = Config::get('curweather', 'appid');
$cachetime = intval(Config::get('curweather', 'cachetime'));
} elseif (!empty($m[1])) {
$token = $m[1];
}
- return (!empty($token)) ? $token : false;
+ return !empty($token) ? $token : false;
}
private function readJsonResponse($response) {
$this->doHttpRequest('/bookmarklet');
$m = [];
preg_match('/"aspects"\:(\[.+?\])/', $this->last_http_result->response, $m);
- return (!empty($m[1])) ? json_decode($m[1]) : false;
+ return !empty($m[1]) ? json_decode($m[1]) : false;
}
public function getServices() {
$this->doHttpRequest('/bookmarklet');
$m = [];
preg_match('/"configured_services"\:(\[.+?\])/', $this->last_http_result->response, $m);
- return (!empty($m[1])) ? json_decode($m[1]) : false;
+ return !empty($m[1]) ? json_decode($m[1]) : false;
}
public function getNotifications($notification_type = '', $show = '') {
$diaspora_post = intval(PConfig::get(local_user(),'diaspora','post'));
- $diaspora_enable = (($diaspora_post && x($_REQUEST,'diaspora_enable')) ? intval($_REQUEST['diaspora_enable']) : 0);
+ $diaspora_enable = (($diaspora_post && !empty($_REQUEST['diaspora_enable'])) ? intval($_REQUEST['diaspora_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'diaspora','post_by_default'))) {
$diaspora_enable = 1;
$dw_post = intval(PConfig::get(local_user(),'dwpost','post'));
- $dw_enable = (($dw_post && x($_REQUEST,'dwpost_enable')) ? intval($_REQUEST['dwpost_enable']) : 0);
+ $dw_enable = (($dw_post && !empty($_REQUEST['dwpost_enable'])) ? intval($_REQUEST['dwpost_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'dwpost','post_by_default'))) {
$dw_enable = 1;
if (!empty($a->data['search'])) {
$search = Strings::escapeTags(trim($a->data['search']));
} else {
- $search = ((!empty($_GET['search'])) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : '');
+ $search = (!empty($_GET['search']) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : '');
}
$tpl = Renderer::getMarkupTemplate('directory_header.tpl');
function fromapp_settings_post($a, $post)
{
- if (!local_user() || (! x($_POST, 'fromapp-submit'))) {
+ if (!local_user() || empty($_POST['fromapp-submit'])) {
return;
}
if (!empty($_POST['fromgplus-submit'])) {
PConfig::set(local_user(),'fromgplus','account',trim($_POST['fromgplus-account']));
- $enable = (x($_POST,'fromgplus-enable') ? intval($_POST['fromgplus-enable']) : 0);
+ $enable = (!empty($_POST['fromgplus-enable']) ? intval($_POST['fromgplus-enable']) : 0);
PConfig::set(local_user(),'fromgplus','enable', $enable);
- $keywords = (x($_POST, 'fromgplus-keywords') ? intval($_POST['fromgplus-keywords']) : 0);
+ $keywords = (!empty($_POST['fromgplus-keywords']) ? intval($_POST['fromgplus-keywords']) : 0);
PConfig::set(local_user(),'fromgplus', 'keywords', $keywords);
if (!$enable)
function fromgplus_addon_admin_post(&$a)
{
- $key = ((x($_POST, 'key')) ? trim($_POST['key']) : '');
+ $key = (!empty($_POST['key']) ? trim($_POST['key']) : '');
Config::set('fromgplus', 'key', $key);
info(L10n::t('Settings updated.'). EOL);
}
function geocoordinates_addon_admin_post(&$a)
{
- $api_key = ((x($_POST, 'api_key')) ? Strings::escapeTags(trim($_POST['api_key'])) : '');
+ $api_key = (!empty($_POST['api_key']) ? Strings::escapeTags(trim($_POST['api_key'])) : '');
Config::set('geocoordinates', 'api_key', $api_key);
- $language = ((x($_POST, 'language')) ? Strings::escapeTags(trim($_POST['language'])) : '');
+ $language = (!empty($_POST['language']) ? Strings::escapeTags(trim($_POST['language'])) : '');
Config::set('geocoordinates', 'language', $language);
info(L10n::t('Settings updated.'). EOL);
}
*/
function geonames_addon_admin_post($a,$post) {
- if(! local_user() || (! x($_POST,'geonames-submit')))
+ if(! local_user() || empty($_POST['geonames-submit']))
return;
PConfig::set(local_user(),'geonames','enable',intval($_POST['geonames']));
*/
function gnot_settings_post($a,$post) {
- if(! local_user() || (! x($_POST,'gnot-submit')))
+ if(! local_user() || empty($_POST['gnot-submit']))
return;
PConfig::set(local_user(),'gnot','enable',intval($_POST['gnot']));
function gravatar_addon_admin_post (&$a) {
BaseModule::checkFormSecurityToken('gravatarsave');
- $default_avatar = ((x($_POST, 'avatar')) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon');
- $rating = ((x($_POST, 'rating')) ? Strings::escapeTags(trim($_POST['rating'])) : 'g');
+ $default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon');
+ $rating = (!empty($_POST['rating']) ? Strings::escapeTags(trim($_POST['rating'])) : 'g');
Config::set('gravatar', 'default_avatar', $default_avatar);
Config::set('gravatar', 'rating', $rating);
info(L10n::t('Gravatar settings updated.') .EOL);
*/
function group_text_settings_post($a,$post) {
- if(! local_user() || (! x($_POST,'group_text-submit')))
+ if(! local_user() || empty($_POST['group_text-submit']))
return;
PConfig::set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text']));
function ifttt_settings_post()
{
- if (x($_POST, 'ifttt-submit') && isset($_POST['ifttt-rekey'])) {
+ if (!empty($_POST['ifttt-submit']) && isset($_POST['ifttt-rekey'])) {
PConfig::delete(local_user(), 'ifttt', 'key');
}
}
function ijpost_settings_post(&$a, &$b)
{
- if (x($_POST, 'ijpost-submit')) {
+ if (!empty($_POST['ijpost-submit'])) {
PConfig::set(local_user(), 'ijpost', 'post', intval($_POST['ijpost']));
PConfig::set(local_user(), 'ijpost', 'post_by_default', intval($_POST['ij_bydefault']));
PConfig::set(local_user(), 'ijpost', 'ij_username', trim($_POST['ij_username']));
$ij_post = intval(PConfig::get(local_user(), 'ijpost', 'post'));
- $ij_enable = (($ij_post && x($_REQUEST, 'ijpost_enable')) ? intval($_REQUEST['ijpost_enable']) : 0);
+ $ij_enable = (($ij_post && !empty($_REQUEST['ijpost_enable'])) ? intval($_REQUEST['ijpost_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(), 'ijpost', 'post_by_default'))) {
$ij_enable = 1;
}
function impressum_addon_admin_post (&$a) {
- $owner = ((x($_POST, 'owner')) ? Strings::escapeTags(trim($_POST['owner'])) : '');
- $ownerprofile = ((x($_POST, 'ownerprofile')) ? Strings::escapeTags(trim($_POST['ownerprofile'])) : '');
- $postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : '');
- $notes = ((x($_POST, 'notes')) ? (trim($_POST['notes'])) : '');
- $email = ((x($_POST, 'email')) ? Strings::escapeTags(trim($_POST['email'])) : '');
- $footer_text = ((x($_POST, 'footer_text')) ? (trim($_POST['footer_text'])) : '');
+ $owner = (!empty($_POST['owner']) ? Strings::escapeTags(trim($_POST['owner'])) : '');
+ $ownerprofile = (!empty($_POST['ownerprofile']) ? Strings::escapeTags(trim($_POST['ownerprofile'])) : '');
+ $postal = (!empty($_POST['postal']) ? (trim($_POST['postal'])) : '');
+ $notes = (!empty($_POST['notes']) ? (trim($_POST['notes'])) : '');
+ $email = (!empty($_POST['email']) ? Strings::escapeTags(trim($_POST['email'])) : '');
+ $footer_text = (!empty($_POST['footer_text']) ? (trim($_POST['footer_text'])) : '');
Config::set('impressum','owner',strip_tags($owner));
Config::set('impressum','ownerprofile',strip_tags($ownerprofile));
Config::set('impressum','postal',strip_tags($postal));
if($autochans)
$channels = $autochans;
else
- $channels = ((x($_GET,'channels')) ? $_GET['channels'] : 'friendica');
+ $channels = defaults($_GET, 'channels', 'friendica');
/* add the chatroom frame and some html */
$o .= <<< EOT
function js_upload_post_end(&$a,&$b) {
Logger::log('upload_post_end');
- if(x($a->data,'upload_jsonresponse')) {
+ if(!empty($a->data['upload_jsonresponse'])) {
echo $a->data['upload_jsonresponse'];
killme();
}
if (!empty($_POST['langfilter-settings-submit'])) {
PConfig::set(local_user(), 'langfilter', 'languages', trim($_POST['langfilter_languages']));
- $enable = (x($_POST, 'langfilter_enable') ? intval($_POST['langfilter_enable']) : 0);
+ $enable = (!empty($_POST['langfilter_enable']) ? intval($_POST['langfilter_enable']) : 0);
$disable = 1 - $enable;
PConfig::set(local_user(), 'langfilter', 'disable', $disable);
$minconfidence = 0 + $_POST['langfilter_minconfidence'];
function libertree_settings_post(&$a,&$b) {
- if(x($_POST,'libertree-submit')) {
+ if(!empty($_POST['libertree-submit'])) {
PConfig::set(local_user(),'libertree','post',intval($_POST['libertree']));
PConfig::set(local_user(),'libertree','post_by_default',intval($_POST['libertree_bydefault']));
$ltree_post = intval(PConfig::get(local_user(),'libertree','post'));
- $ltree_enable = (($ltree_post && x($_REQUEST,'libertree_enable')) ? intval($_REQUEST['libertree_enable']) : 0);
+ $ltree_enable = (($ltree_post && !empty($_REQUEST['libertree_enable'])) ? intval($_REQUEST['libertree_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'libertree','post_by_default'))) {
$ltree_enable = 1;
{
BaseModule::checkFormSecurityToken('libravatarrsave');
- $default_avatar = ((x($_POST, 'avatar')) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon');
+ $default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon');
Config::set('libravatar', 'default_avatar', $default_avatar);
info(L10n::t('Libravatar settings updated.') .EOL);
}
function ljpost_settings_post(&$a,&$b) {
- if(x($_POST,'ljpost-submit')) {
+ if(!empty($_POST['ljpost-submit'])) {
PConfig::set(local_user(),'ljpost','post',intval($_POST['ljpost']));
PConfig::set(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault']));
$lj_post = intval(PConfig::get(local_user(),'ljpost','post'));
- $lj_enable = (($lj_post && x($_REQUEST,'ljpost_enable')) ? intval($_REQUEST['ljpost_enable']) : 0);
+ $lj_enable = (($lj_post && !empty($_REQUEST['ljpost_enable'])) ? intval($_REQUEST['ljpost_enable']) : 0);
if($b['api_source'] && intval(PConfig::get(local_user(),'ljpost','post_by_default')))
$lj_enable = 1;
}
function mailstream_addon_admin_post ($a) {
- if (x($_POST, 'frommail')) {
+ if (!empty($_POST['frommail'])) {
Config::set('mailstream', 'frommail', $_POST['frommail']);
}
}
function newmemberwidget_addon_admin_post(&$a)
{
- $ft = ((x($_POST, 'freetext')) ? trim($_POST['freetext']) : "");
- $lsn = ((x($_POST, 'localsupportname')) ? Strings::escapeTags(trim($_POST['localsupportname'])) : "");
+ $ft = (!empty($_POST['freetext']) ? trim($_POST['freetext']) : "");
+ $lsn = (!empty($_POST['localsupportname']) ? Strings::escapeTags(trim($_POST['localsupportname'])) : "");
$gs = intval($_POST['linkglobalsupport']);
$ls = intval($_POST['linklocalsupport']);
Config::set('newmemberwidget', 'freetext', trim($ft));
$sender_name = '"' . L10n::t('%1$s, %2$s Administrator', Config::get('config', 'admin_name'), $sitename) . '"';
}
- if (! x(Config::get('config', 'sender_email'))) {
+ if (!Config::get('config', 'sender_email')) {
$sender_email = 'noreply@' . $a->getHostName();
} else {
$sender_email = Config::get('config', 'sender_email');
function notimeline_settings_post($a, $post)
{
- if (!local_user() || (!x($_POST, 'notimeline-submit'))) {
+ if (!local_user() || empty($_POST['notimeline-submit'])) {
return;
}
if (!empty($_POST['nsfw-submit'])) {
PConfig::set(local_user(), 'nsfw', 'words', trim($_POST['nsfw-words']));
- $enable = (x($_POST, 'nsfw-enable') ? intval($_POST['nsfw-enable']) : 0);
+ $enable = (!empty($_POST['nsfw-enable']) ? intval($_POST['nsfw-enable']) : 0);
$disable = 1 - $enable;
PConfig::set(local_user(), 'nsfw', 'disable', $disable);
info(L10n::t('NSFW Settings saved.') . EOL);
*
*/
function numfriends_settings_post($a,$post) {
- if(! local_user() || (! x($_POST,'numfriends-submit')))
+ if(! local_user() || empty($_POST['numfriends-submit']))
return;
PConfig::set(local_user(),'system','display_friend_count',intval($_POST['numfriends']));
]);
}
function piwik_addon_admin_post (&$a) {
- $url = ((x($_POST, 'baseurl')) ? Strings::escapeTags(trim($_POST['baseurl'])) : '');
- $id = ((x($_POST, 'siteid')) ? trim($_POST['siteid']) : '');
- $optout = ((x($_POST, 'optout')) ? trim($_POST['optout']) : '');
- $async = ((x($_POST, 'async')) ? trim($_POST['async']) : '');
+ $url = (!empty($_POST['baseurl']) ? Strings::escapeTags(trim($_POST['baseurl'])) : '');
+ $id = (!empty($_POST['siteid']) ? trim($_POST['siteid']) : '');
+ $optout = (!empty($_POST['optout']) ? trim($_POST['optout']) : '');
+ $async = (!empty($_POST['async']) ? trim($_POST['async']) : '');
Config::set('piwik', 'baseurl', $url);
Config::set('piwik', 'siteid', $id);
Config::set('piwik', 'optout', $optout);
function public_server_enotify(&$a, &$b)
{
- if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM
- && x($b['params'], 'system_type') && $b['params']['system_type'] === 'public_server_expire') {
+ if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM
+ && !empty($b['params']['system_type']) && $b['params']['system_type'] === 'public_server_expire') {
$b['itemlink'] = $a->getBaseURL();
$b['epreamble'] = $b['preamble'] = L10n::t('Your account on %s will expire in a few days.', Config::get('system', 'sitename'));
$b['subject'] = L10n::t('Your Friendica account is about to expire.');
function public_server_addon_admin_post(&$a)
{
BaseModule::checkFormSecurityTokenRedirectOnError('/admin/addons/publicserver', 'publicserver');
- $expiredays = (x($_POST, 'expiredays') ? Strings::escapeTags(trim($_POST['expiredays'])) : '');
- $expireposts = (x($_POST, 'expireposts') ? Strings::escapeTags(trim($_POST['expireposts'])) : '');
- $nologin = (x($_POST, 'nologin') ? Strings::escapeTags(trim($_POST['nologin'])) : '');
- $flagusers = (x($_POST, 'flagusers') ? Strings::escapeTags(trim($_POST['flagusers'])) : '');
- $flagposts = (x($_POST, 'flagposts') ? Strings::escapeTags(trim($_POST['flagposts'])) : '');
- $flagpostsexpire = (x($_POST, 'flagpostsexpire') ? Strings::escapeTags(trim($_POST['flagpostsexpire'])) : '');
+ $expiredays = (!empty($_POST['expiredays']) ? Strings::escapeTags(trim($_POST['expiredays'])) : '');
+ $expireposts = (!empty($_POST['expireposts']) ? Strings::escapeTags(trim($_POST['expireposts'])) : '');
+ $nologin = (!empty($_POST['nologin']) ? Strings::escapeTags(trim($_POST['nologin'])) : '');
+ $flagusers = (!empty($_POST['flagusers']) ? Strings::escapeTags(trim($_POST['flagusers'])) : '');
+ $flagposts = (!empty($_POST['flagposts']) ? Strings::escapeTags(trim($_POST['flagposts'])) : '');
+ $flagpostsexpire = (!empty($_POST['flagpostsexpire']) ? Strings::escapeTags(trim($_POST['flagpostsexpire'])) : '');
Config::set('public_server', 'expiredays', $expiredays);
Config::set('public_server', 'expireposts', $expireposts);
Config::set('public_server', 'nologin', $nologin);
}
function remote_permissions_settings_post($a,$post) {
- if(! local_user() || (! x($_POST,'remote-perms-submit')))
+ if(! local_user() || empty($_POST['remote-perms-submit']))
return;
PConfig::set(local_user(),'remote_perms','show',intval($_POST['remote-perms']));
}
function remote_permissions_addon_admin_post(&$a){
- $choice = ((x($_POST,'remotepermschoice')) ? Strings::escapeTags(trim($_POST['remotepermschoice'])) : '');
+ $choice = (!empty($_POST['remotepermschoice']) ? Strings::escapeTags(trim($_POST['remotepermschoice'])) : '');
Config::set('remote_perms','global',($choice == 1 ? 1 : 0));
info(L10n::t('Settings updated.'). EOL);
}
if ($_POST['securemail-submit']) {
PConfig::set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey']));
- $enable = ((x($_POST, 'securemail-enable')) ? 1 : 0);
+ $enable = (!empty($_POST['securemail-enable']) ? 1 : 0);
PConfig::set(local_user(), 'securemail', 'enable', $enable);
info(L10n::t('Secure Mail Settings saved.') . EOL);
* @see App
*/
function securemail_emailer_send_prepare(App &$a, array &$b) {
- if (!x($b, 'uid')) {
+ if (empty($b['uid'])) {
return;
}
$public_key_ascii = PConfig::get($uid, 'securemail', 'pkey');
preg_match('/-----BEGIN ([A-Za-z ]+)-----/', $public_key_ascii, $matches);
- $marker = (empty($matches[1])) ? 'MESSAGE' : $matches[1];
+ $marker = empty($matches[1]) ? 'MESSAGE' : $matches[1];
$public_key = OpenPGP::unarmor($public_key_ascii, $marker);
$key = OpenPGP_Message::parse($public_key);
if (!empty($_POST['showmore-submit'])) {
PConfig::set(local_user(), 'showmore', 'chars', trim($_POST['showmore-chars']));
- $enable = (x($_POST, 'showmore-enable') ? intval($_POST['showmore-enable']) : 0);
+ $enable = (!empty($_POST['showmore-enable']) ? intval($_POST['showmore-enable']) : 0);
$disable = 1-$enable;
PConfig::set(local_user(), 'showmore', 'disable', $disable);
info(L10n::t('Show More Settings saved.') . EOL);
return;
}
// don't check GNU Social settings if GNU Social submit button is not clicked
- if (!x($_POST, 'statusnet-submit')) {
+ if (empty($_POST['statusnet-submit'])) {
return;
}
}
$statusnet_post = PConfig::get(local_user(), 'statusnet', 'post');
- $statusnet_enable = (($statusnet_post && x($_REQUEST, 'statusnet_enable')) ? intval($_REQUEST['statusnet_enable']) : 0);
+ $statusnet_enable = (($statusnet_post && !empty($_REQUEST['statusnet_enable'])) ? intval($_REQUEST['statusnet_enable']) : 0);
// if API is used, default to the chosen settings
if ($b['api_source'] && intval(PConfig::get(local_user(), 'statusnet', 'post_by_default'))) {
}
$secret = trim($_POST['secret'][$id]);
$key = trim($_POST['key'][$id]);
- //$applicationname = ((x($_POST, 'applicationname')) ? Strings::escapeTags(trim($_POST['applicationname'][$id])):'');
+ //$applicationname = (!empty($_POST['applicationname']) ? Strings::escapeTags(trim($_POST['applicationname'][$id])):'');
if ($sitename != "" &&
$apiurl != "" &&
$secret != "" &&
$key != "" &&
- !x($_POST['delete'][$id])) {
+ empty($_POST['delete'][$id])) {
$sites[] = [
'sitename' => $sitename,
}
function testdrive_enotify(&$a, &$b) {
- if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM
- && x($b['params'], 'system_type') && $b['params']['system_type'] === 'testdrive_expire') {
+ if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM
+ && !empty($b['params']['system_type']) && $b['params']['system_type'] === 'testdrive_expire') {
$b['itemlink'] = $a->getBaseURL();
$b['epreamble'] = $b['preamble'] = L10n::t('Your account on %s will expire in a few days.', Config::get('system', 'sitename'));
$b['subject'] = L10n::t('Your Friendica test account is about to expire.');
function tumblr_addon_admin_post(App $a)
{
- $consumer_key = ((!empty($_POST['consumer_key'])) ? Strings::escapeTags(trim($_POST['consumer_key'])) : '');
- $consumer_secret = ((!empty($_POST['consumer_secret'])) ? Strings::escapeTags(trim($_POST['consumer_secret'])): '');
+ $consumer_key = (!empty($_POST['consumer_key']) ? Strings::escapeTags(trim($_POST['consumer_key'])) : '');
+ $consumer_secret = (!empty($_POST['consumer_secret']) ? Strings::escapeTags(trim($_POST['consumer_secret'])): '');
Config::set('tumblr', 'consumer_key',$consumer_key);
Config::set('tumblr', 'consumer_secret',$consumer_secret);
}
$twitter_post = intval(PConfig::get(local_user(), 'twitter', 'post'));
- $twitter_enable = (($twitter_post && x($_REQUEST, 'twitter_enable')) ? intval($_REQUEST['twitter_enable']) : 0);
+ $twitter_enable = (($twitter_post && !empty($_REQUEST['twitter_enable'])) ? intval($_REQUEST['twitter_enable']) : 0);
// if API is used, default to the chosen settings
if ($b['api_source'] && intval(PConfig::get(local_user(), 'twitter', 'post_by_default'))) {
function twitter_addon_admin_post(App $a)
{
- $consumerkey = x($_POST, 'consumerkey') ? Strings::escapeTags(trim($_POST['consumerkey'])) : '';
- $consumersecret = x($_POST, 'consumersecret') ? Strings::escapeTags(trim($_POST['consumersecret'])) : '';
+ $consumerkey = !empty($_POST['consumerkey']) ? Strings::escapeTags(trim($_POST['consumerkey'])) : '';
+ $consumersecret = !empty($_POST['consumersecret']) ? Strings::escapeTags(trim($_POST['consumersecret'])) : '';
Config::set('twitter', 'consumerkey', $consumerkey);
Config::set('twitter', 'consumersecret', $consumersecret);
info(L10n::t('Settings updated.') . EOL);
]);
}
function webrtc_addon_admin_post (&$a) {
- $url = ((x($_POST, 'webrtcurl')) ? Strings::escapeTags(trim($_POST['webrtcurl'])) : '');
+ $url = (!empty($_POST['webrtcurl']) ? Strings::escapeTags(trim($_POST['webrtcurl'])) : '');
Config::set('webrtc', 'webrtcurl', $url);
info(L10n::t('Settings updated.'). EOL);
}
*/
function windowsphonepush_settings_post($a, $post)
{
- if (!local_user() || (!x($_POST, 'windowsphonepush-submit'))) {
+ if (!local_user() || empty($_POST['windowsphonepush-submit'])) {
return;
}
$enable = intval($_POST['windowsphonepush']);
function wppost_settings_post(&$a,&$b) {
- if(x($_POST,'wppost-submit')) {
+ if(!empty($_POST['wppost-submit'])) {
PConfig::set(local_user(),'wppost','post',intval($_POST['wppost']));
PConfig::set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault']));
$wp_post = intval(PConfig::get(local_user(),'wppost','post'));
- $wp_enable = (($wp_post && x($_REQUEST,'wppost_enable')) ? intval($_REQUEST['wppost_enable']) : 0);
+ $wp_enable = (($wp_post && !empty($_REQUEST['wppost_enable'])) ? intval($_REQUEST['wppost_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'wppost','post_by_default'))) {
$wp_enable = 1;
function xmpp_addon_admin_post()
{
- $bosh_proxy = ((!empty($_POST['bosh_proxy'])) ? trim($_POST['bosh_proxy']) : '');
- $central_userbase = ((!empty($_POST['central_userbase'])) ? intval($_POST['central_userbase']) : false);
+ $bosh_proxy = (!empty($_POST['bosh_proxy']) ? trim($_POST['bosh_proxy']) : '');
+ $central_userbase = (!empty($_POST['central_userbase']) ? intval($_POST['central_userbase']) : false);
Config::set('xmpp', 'bosh_proxy', $bosh_proxy);
Config::set('xmpp', 'central_userbase', $central_userbase);