Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ protected function getListQuery()
}

// If component item type supports access level, select the access level also.
if (\array_key_exists('acl', $support) && $support['acl'] == true && !empty($fields['access'])) {
if (\array_key_exists('acl', $support) && $support['acl'] && !empty($fields['access'])) {
$query->select($db->quoteName($fields['access'], 'access'));

// Join over the access levels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public function getItems()
{
$items = parent::getItems();

if ($items != false) {
if ($items) {
$extension = $this->getState('filter.extension');

$this->countItems($items, $extension);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,11 @@ public function save($data)
}

// Give a warning if the cache-folder can not be opened
if ($data['caching'] > 0 && $data['cache_handler'] == 'file' && @opendir($path) == false) {
if ($data['caching'] > 0 && $data['cache_handler'] == 'file' && @opendir($path) === false) {
$error = true;

// If a custom path is in use, try using the system default instead of disabling cache
if ($path !== JPATH_CACHE && @opendir(JPATH_CACHE) != false) {
if ($path !== JPATH_CACHE && @opendir(JPATH_CACHE) !== false) {
try {
Log::add(
Text::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_CACHE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ public function save($data)
$check = $input->post->get('jform', [], 'array');

foreach ($data['urls'] as $i => $url) {
if ($url != false && ($i == 'urla' || $i == 'urlb' || $i == 'urlc')) {
if (trim($url) !== '' && ($i == 'urla' || $i == 'urlb' || $i == 'urlc')) {
if (preg_match('~^#[a-zA-Z]{1}[a-zA-Z0-9-_:.]*$~', $check['urls'][$i]) == 1) {
$data['urls'][$i] = $check['urls'][$i];
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public static function explained(IndexerQuery $query)

// Process the required tokens.
foreach ($query->included as $token) {
if ($token->required && (!isset($token->derived) || $token->derived == false)) {
if ($token->required && (!isset($token->derived) || !$token->derived)) {
$parts[] = '<span class="query-required">' . Text::sprintf('COM_FINDER_QUERY_TOKEN_REQUIRED', $token->term) . '</span>';
}
}

// Process the optional tokens.
foreach ($query->included as $token) {
if (!$token->required && (!isset($token->derived) || $token->derived == false)) {
if (!$token->required && (!isset($token->derived) || !$token->derived)) {
$parts[] = '<span class="query-optional">' . Text::sprintf('COM_FINDER_QUERY_TOKEN_OPTIONAL', $token->term) . '</span>';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,6 @@ public function getForm($data = [], $loadData = true)
Form::addFieldPath(JPATH_COMPONENT . '/models/fields');
$form = Form::getInstance('com_installer.update', 'update', ['load_data' => $loadData]);

// Check for an error.
if ($form == false) {
$this->setError($form->getMessage());

return false;
}

// Check the session for previously entered form data.
$data = $this->loadFormData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null)
{
$result = parent::setup($element, $value, $group);

if ($result == true) {
if ($result) {
$menuType = (string) $this->element['menu_type'];

if (!$menuType) {
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/src/Model/ItemModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
// If an XML file was found in the component, load it first.
// We need to qualify the full path to avoid collisions with component file names.

if ($form->loadFile($formFile, true, '/metadata') == false) {
if (!$form->loadFile($formFile, true, '/metadata')) {
throw new \Exception(Text::_('JERROR_LOADFILE_FAILED'));
}

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_redirect/src/Model/LinkModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getForm($data = [], $loadData = true)
}

// Modify the form based on access controls.
if ($this->canEditState((object) $data) != true) {
if (!$this->canEditState((object)$data)) {
// Disable fields for display.
$form->setFieldAttribute('published', 'disabled', 'true');

Expand All @@ -83,7 +83,7 @@ public function getForm($data = [], $loadData = true)

// If in advanced mode then we make sure the new URL field is not compulsory and the header
// field compulsory in case people select non-3xx redirects
if (ComponentHelper::getParams('com_redirect')->get('mode', 0) == true) {
if (ComponentHelper::getParams('com_redirect')->get('mode', 0)) {
$form->setFieldAttribute('new_url', 'required', 'false');
$form->setFieldAttribute('header', 'required', 'true');
}
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_redirect/src/Table/LinkTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ public function check()
}

// Check for valid name if not in advanced mode.
if (empty($this->new_url) && ComponentHelper::getParams('com_redirect')->get('mode', 0) == false) {
if (empty($this->new_url) && !ComponentHelper::getParams('com_redirect')->get('mode', 0)) {
$this->setError(Text::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED'));

return false;
}

if (empty($this->new_url) && ComponentHelper::getParams('com_redirect')->get('mode', 0) == true) {
if (empty($this->new_url) && ComponentHelper::getParams('com_redirect')->get('mode', 0)) {
// Else if an empty URL and in redirect mode only throw the same error if the code is a 3xx status code
if ($this->header < 400 && $this->header >= 300) {
$this->setError(Text::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED'));
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_tags/src/Model/TagsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function getItems()
{
$items = parent::getItems();

if ($items != false) {
if ($items) {
$extension = $this->getState('filter.extension', '');

$this->countItems($items, $extension);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ public function deleteFolder()
} elseif ($model->deleteFolder($location)) {
$this->setMessage(Text::_('COM_TEMPLATES_FOLDER_DELETE_SUCCESS'));

if (stristr(base64_decode($file), $location) != false) {
if (stristr(base64_decode($file), $location)) {
$file = base64_encode('home');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function canUpload($file, $err = '')

$allowable = array_merge($imageTypes, $sourceTypes, $fontTypes, $archiveTypes);

if ($format == '' || $format == false || (!\in_array($format, $allowable))) {
if ($format === '' || !\in_array($format, $allowable)) {
$app = Factory::getApplication();
$app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_WARNFILETYPE'), 'error');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,9 +1174,9 @@ public function createOverride($override)
$name = end($explodeArray);
$client = ApplicationHelper::getClientInfo($template->client_id);

if (stristr($name, 'mod_') != false) {
if (stristr($name, 'mod_') !== false) {
$htmlPath = Path::clean($client->path . '/templates/' . $template->element . '/html/' . $name);
} elseif (stristr($override, 'com_') != false) {
} elseif (stristr($override, 'com_') !== false) {
$size = \count($explodeArray);

$url = Path::clean($explodeArray[$size - 3] . '/' . $explodeArray[$size - 1]);
Expand All @@ -1202,9 +1202,9 @@ public function createOverride($override)
return false;
}

if (stristr($name, 'mod_') != false) {
if (stristr($name, 'mod_') !== false) {
$return = $this->createTemplateOverride(Path::clean($override . '/tmpl'), $htmlPath);
} elseif (stristr($override, 'com_') != false && stristr($override, 'layouts') == false) {
} elseif (stristr($override, 'com_') !== false && stristr($override, 'layouts') === false) {
$path = $override . '/tmpl';

// View can also be in the top level folder
Expand Down Expand Up @@ -1703,7 +1703,7 @@ public function getFont()
$fileName = end($explodeArray);
$path = $this->getBasePath() . base64_decode($app->getInput()->get('file'));

if (stristr($client->path, 'administrator') == false) {
if (stristr($client->path, 'administrator') === false) {
$folder = '/templates/';
} else {
$folder = '/administrator/templates/';
Expand Down
2 changes: 1 addition & 1 deletion administrator/modules/mod_feed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
$direction = ' redirect-rtl';
}

if ($feed != false) :
if ($feed) :
?>
<div style="direction: <?php echo $rssrtl ? 'rtl' : 'ltr'; ?>; text-align: <?php echo $rssrtl ? 'right' : 'left'; ?> !important" class="feed">
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private function _sendEmail($data, $contact, $emailCopyToSender)
$sent = $mailer->send();

// If we are supposed to copy the sender, do so.
if ($emailCopyToSender == true && !empty($data['contact_email_copy'])) {
if ($emailCopyToSender && !empty($data['contact_email_copy'])) {
$mailer = new MailTemplate('com_contact.mail.copy', $app->getLanguage()->getTag());
$mailer->addRecipient($templateData['email']);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function export()

$exportData = $model->collectDataForExportRequest();

if ($exportData == false) {
if (!$exportData) {
throw new RouteNotFoundException('Item does not exist');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private function _sendEmail($data, $contact, $emailCopyToSender)
$sent = $mailer->send();

// If we are supposed to copy the sender, do so.
if ($emailCopyToSender == true && !empty($data['contact_email_copy'])) {
if ($emailCopyToSender && !empty($data['contact_email_copy'])) {
$mailer = new MailTemplate('com_contact.mail.copy', $app->getLanguage()->getTag());
$mailer->addRecipient($templateData['email']);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/src/Model/FeaturedModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected function populateState($ordering = null, $direction = null)
}

// Check for category selection
if ($params->get('featured_categories') && implode(',', $params->get('featured_categories')) == true) {
if ($params->get('featured_categories') && implode(',', $params->get('featured_categories'))) {
$featuredCategories = $params->get('featured_categories');
$this->setState('filter.frontpage.categories', $featuredCategories);
}
Expand Down
4 changes: 2 additions & 2 deletions components/com_content/src/View/Article/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function display($tpl = null)
$offset = (int) $this->state->get('list.offset');

// Check the view access to the article (the model has already computed the values).
if ($item->params->get('access-view') == false && ($item->params->get('show_noauth', '0') == '0')) {
if (!$item->params->get('access-view') && ($item->params->get('show_noauth', '0') == '0')) {
$app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error');
$app->setHeader('status', 403, true);

Expand All @@ -192,7 +192,7 @@ public function display($tpl = null)
* - Deny access to logged users with 403 code
* NOTE: we do not recheck for no access-view + show_noauth disabled ... since it was checked above
*/
if ($item->params->get('access-view') == false && !\strlen($item->fulltext)) {
if (!$item->params->get('access-view') && !\strlen($item->fulltext)) {
if ($this->user->guest) {
$return = base64_encode(Uri::getInstance());
$login_url_with_return = Route::_('index.php?option=com_users&view=login&return=' . $return);
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/tmpl/article/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php // Optional teaser intro text for guests ?>
<?php elseif ($params->get('show_noauth') == true && $user->guest) : ?>
<?php elseif ($params->get('show_noauth') && $user->guest) : ?>
<?php echo LayoutHelper::render('joomla.content.intro_image', $this->item); ?>
<?php echo HTMLHelper::_('content.prepare', $this->item->introtext); ?>
<?php // Optional link to let them register to see the whole article. ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/tmpl/category/default_articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
<?php if (!empty($article->author) || !empty($article->created_by_alias)) : ?>
<?php $author = $article->author ?>
<?php $author = $article->created_by_alias ?: $author; ?>
<?php if (!empty($article->contact_link) && $this->params->get('link_author') == true) : ?>
<?php if (!empty($article->contact_link) && $this->params->get('link_author')) : ?>
<?php if ($this->params->get('show_headings')) : ?>
<?php echo HTMLHelper::_('link', $article->contact_link, $author); ?>
<?php else : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_tags/tmpl/tags/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class="inputbox" onchange="document.adminForm.submit();"
<?php endif; ?>
</form>

<?php if ($this->items == false || $n === 0) : ?>
<?php if (!$this->items || $n === 0) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_TAGS_NO_TAGS'); ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/src/Controller/RemindController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function remind()
$return = $model->processRemindRequest($data);

// Check for a hard error.
if ($return == false && JDEBUG) {
if (!$return && JDEBUG) {
// The request failed.
// Go back to the request form.
$message = Text::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError());
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/src/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function login()
}

// Success
if ($options['remember'] == true) {
if ($options['remember']) {
$this->app->setUserState('rememberLogin', true);
}

Expand Down
2 changes: 1 addition & 1 deletion layouts/joomla/content/info_block/author.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span class="icon-user icon-fw" aria-hidden="true"></span>
<?php $author = ($displayData['item']->created_by_alias ?: $displayData['item']->author); ?>
<?php $author = '<span>' . $author . '</span>'; ?>
<?php if (!empty($displayData['item']->contact_link) && $displayData['params']->get('link_author') == true) : ?>
<?php if (!empty($displayData['item']->contact_link) && $displayData['params']->get('link_author')) : ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY', HTMLHelper::_('link', $displayData['item']->contact_link, $author)); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
Expand Down
6 changes: 3 additions & 3 deletions libraries/src/Application/CLI/ColorStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ final class ColorStyle
public function __construct(string $fg = '', string $bg = '', array $options = [])
{
if ($fg) {
if (\array_key_exists($fg, static::$knownColors) == false) {
if (!\array_key_exists($fg, static::$knownColors)) {
throw new \InvalidArgumentException(
\sprintf(
'Invalid foreground color "%1$s" [%2$s]',
Expand All @@ -120,7 +120,7 @@ public function __construct(string $fg = '', string $bg = '', array $options = [
}

if ($bg) {
if (\array_key_exists($bg, static::$knownColors) == false) {
if (!\array_key_exists($bg, static::$knownColors)) {
throw new \InvalidArgumentException(
\sprintf(
'Invalid background color "%1$s" [%2$s]',
Expand All @@ -134,7 +134,7 @@ public function __construct(string $fg = '', string $bg = '', array $options = [
}

foreach ($options as $option) {
if (\array_key_exists($option, static::$knownOptions) == false) {
if (!\array_key_exists($option, static::$knownOptions)) {
throw new \InvalidArgumentException(
\sprintf(
'Invalid option "%1$s" [%2$s]',
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ public function login($credentials, $options = [])
$user->cookieLogin = true;
}

if (\in_array(false, $results, true) == false) {
if (!\in_array(false, $results, true)) {
$options['user'] = $user;
$options['responseType'] = $response->type;

Expand Down
6 changes: 3 additions & 3 deletions libraries/src/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public function lock($id, $group = null, $locktime = null)
*/
$handler = $this->_getStorage();

if ($this->_options['locking'] == true) {
if ($this->_options['locking']) {
$locked = $handler->lock($id, $group, $locktime);

if ($locked !== false) {
Expand All @@ -397,7 +397,7 @@ public function lock($id, $group = null, $locktime = null)
$looptime = $locktime * 10;
$id2 = $id . '_lock';

if ($this->_options['locking'] == true) {
if ($this->_options['locking']) {
$data_lock = $handler->get($id2, $group, $this->_options['checkTime']);
} else {
$data_lock = false;
Expand All @@ -421,7 +421,7 @@ public function lock($id, $group = null, $locktime = null)
}
}

if ($this->_options['locking'] == true) {
if ($this->_options['locking']) {
$returning->locked = $handler->store($id2, $group, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Cache/Storage/FileStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function get($id, $group, $checkTime = true)
$path = $this->_getFilePath($id, $group);
$close = false;

if ($checkTime == false || ($checkTime == true && $this->_checkExpire($id, $group) === true)) {
if (!$checkTime || ($checkTime && $this->_checkExpire($id, $group))) {
if (file_exists($path)) {
if (isset($this->_locked_files[$path])) {
$_fileopen = $this->_locked_files[$path];
Expand Down
Loading