-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Type safe comparison of strings only, in libraries/cms #13275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type safe comparison of strings only, in libraries/cms #13275
Conversation
# Conflicts: # libraries/cms/installer/installer.php # libraries/cms/schema/changeitem.php # libraries/cms/schema/changeset.php
|
Conflicts resolved... |
# Conflicts: # libraries/cms/component/router/rules/standard.php
|
Conflicts resolved. Pls check and merge. |
libraries/cms/application/cms.php
Outdated
|
|
||
| // If gzip compression is enabled in configuration and the server is compliant, compress the output. | ||
| if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler')) | ||
| if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') !== 'ob_gzhandler')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/application/site.php
Outdated
| $file = $this->input->get('tmpl', 'index'); | ||
|
|
||
| if (!$this->get('offline') && ($file == 'offline')) | ||
| if (!$this->get('offline') && ($file === 'offline')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
|
|
||
| // Add an option to show all? | ||
| $showAll = isset($this->element['showall']) ? ($this->element['showall'] == 'true') : true; | ||
| $showAll = isset($this->element['showall']) ? ($this->element['showall'] === 'true') : true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/form/field/tag.php
Outdated
| { | ||
| // If mode="nested" || ( mode not set & config = nested ) | ||
| if ((isset($this->element['mode']) && $this->element['mode'] == 'nested') | ||
| if ((isset($this->element['mode']) && $this->element['mode'] === 'nested') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/html/grid.php
Outdated
| else | ||
| { | ||
| $direction = ($direction == 'desc') ? 'asc' : 'desc'; | ||
| $direction = ($direction === 'desc') ? 'asc' : 'desc'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/html/searchtools.php
Outdated
| else | ||
| { | ||
| $direction = ($direction == 'desc') ? 'asc' : 'desc'; | ||
| $direction = ($direction === 'desc') ? 'asc' : 'desc'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
| $this->extension->state = 0; | ||
| $this->extension->name = $manifest_details['name']; | ||
| $this->extension->enabled = ('editors' == $this->extension->folder) ? 1 : 0; | ||
| $this->extension->enabled = ('editors' === $this->extension->folder) ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
| foreach ($element->children() as $file) | ||
| { | ||
| $fCharset = (strtolower($file->attributes()->charset) == 'utf8') ? 'utf8' : ''; | ||
| $fCharset = (strtolower($file->attributes()->charset) === 'utf8') ? 'utf8' : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
|
|
||
| // Is this path a file or folder? | ||
| $path['type'] = ($file->getName() == 'folder') ? 'folder' : 'file'; | ||
| $path['type'] = ($file->getName() === 'folder') ? 'folder' : 'file'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
|
|
||
| // Is this path a file or folder? | ||
| $path['type'] = ($file->getName() == 'folder') ? 'folder' : 'file'; | ||
| $path['type'] = ($file->getName() === 'folder') ? 'folder' : 'file'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/module/helper.php
Outdated
| // Get the template and file name from the string | ||
| $temp = explode(':', $layout); | ||
| $template = ($temp[0] == '_') ? $template : $temp[0]; | ||
| $template = ($temp[0] === '_') ? $template : $temp[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/plugin/helper.php
Outdated
| // Get the template and file name from the string | ||
| $temp = explode(':', $layout); | ||
| $template = ($temp[0] == '_') ? $template : $temp[0]; | ||
| $template = ($temp[0] === '_') ? $template : $temp[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/module/helper.php
Outdated
| $template = ($temp[0] == '_') ? $template : $temp[0]; | ||
| $template = ($temp[0] === '_') ? $template : $temp[0]; | ||
| $layout = $temp[1]; | ||
| $defaultLayout = ($temp[1]) ? $temp[1] : 'default'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
libraries/cms/plugin/helper.php
Outdated
| $template = ($temp[0] == '_') ? $template : $temp[0]; | ||
| $template = ($temp[0] === '_') ? $template : $temp[0]; | ||
| $layout = $temp[1]; | ||
| $defaultLayout = ($temp[1]) ? $temp[1] : 'default'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
|
I have tested this item ✅ successfully on bae19d7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13275. |
|
I have tested this item ✅ successfully on bae19d7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13275. |
|
RTC after two successful tests. |
Summary of Changes
This PR is part of a set to try to separate some of the changes done in one of my previous batch PR's for the libraries/cms directory, which is still on hold (#12171).
Once the new set is merged completely, it will hopefully reduce the changes in that PR, so it can be reviewed easier and finally be merged.
The changes in this PR should be very easy to review, as they are only string and string type comparisons. In hope that this will get merged quickly. ;)
Note: Don't bother if some possible changes are missing or could be differently written. They are probably in the batch PR , that this one references. As soon as this set of sub PR's is merged, the batch PR will have its conflicts resolved and should be a lot easier to review and finally get merged.
Testing Instructions
None, should not change behavior
Documentation Changes Required
None.