mirror of
https://github.com/friendica/friendica
synced 2025-04-27 07:10:12 +00:00
Replace x() by isset(), !empty() or defaults()
- Remove extraneous parentheses around empty() calls - Remove duplicate calls to intval(), count() or strlen() after empty() - Replace ternary operators outputting binary value with empty() return value - Rewrite defaults() without x()
This commit is contained in:
parent
ea4e772b1e
commit
458981f75c
101 changed files with 896 additions and 914 deletions
|
@ -67,7 +67,7 @@ class Post extends BaseObject
|
|||
$this->setTemplate('wall');
|
||||
$this->toplevel = $this->getId() == $this->getDataValue('parent');
|
||||
|
||||
if (x($_SESSION, 'remote') && is_array($_SESSION['remote'])) {
|
||||
if (!empty($_SESSION['remote']) && is_array($_SESSION['remote'])) {
|
||||
foreach ($_SESSION['remote'] as $visitor) {
|
||||
if ($visitor['cid'] == $this->getDataValue('contact-id')) {
|
||||
$this->visiting = true;
|
||||
|
@ -253,7 +253,7 @@ class Post extends BaseObject
|
|||
$responses = get_responses($conv_responses, $response_verbs, $this, $item);
|
||||
|
||||
foreach ($response_verbs as $value => $verbs) {
|
||||
$responses[$verbs]['output'] = x($conv_responses[$verbs], $item['uri']) ? format_like($conv_responses[$verbs][$item['uri']], $conv_responses[$verbs][$item['uri'] . '-l'], $verbs, $item['uri']) : '';
|
||||
$responses[$verbs]['output'] = !empty($conv_responses[$verbs][$item['uri']]) ? format_like($conv_responses[$verbs][$item['uri']], $conv_responses[$verbs][$item['uri'] . '-l'], $verbs, $item['uri']) : '';
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -678,7 +678,7 @@ class Post extends BaseObject
|
|||
*/
|
||||
private function setTemplate($name)
|
||||
{
|
||||
if (!x($this->available_templates, $name)) {
|
||||
if (empty($this->available_templates[$name])) {
|
||||
Logger::log('[ERROR] Item::setTemplate : Template not available ("' . $name . '").', Logger::DEBUG);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue