-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Unnecessary double quotes in /libraries/joomla #13372
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
Merged
wilsonge
merged 9 commits into
joomla:staging
from
frankmayer:unnecessary-double-quotes-in-libraries-joomla
Jan 12, 2017
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
00ec2ff
Replace unnecessary double quotes in /libraries/joomla
frankmayer 4a8dc06
Formatting
frankmayer 6c356e9
CS Fix
frankmayer 5c091c8
Fixes, based on @andrepereiradasilva's comments.
frankmayer da3d778
Change remove string concatenations for some occurrences.
frankmayer e3348a1
Fixes, based on @andrepereiradasilva's comments.
frankmayer 01aeea2
Fixes, based on @andrepereiradasilva's comments.
frankmayer 6617b61
Fixes, based on @andrepereiradasilva's comments.
frankmayer cc06e52
Merge branch 'staging' into unnecessary-double-quotes-in-libraries-jo…
frankmayer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,19 +26,19 @@ | |
| define('CRLF', "\r\n"); | ||
| } | ||
|
|
||
| if (!defined("FTP_AUTOASCII")) | ||
| if (!defined('FTP_AUTOASCII')) | ||
| { | ||
| define("FTP_AUTOASCII", -1); | ||
| define('FTP_AUTOASCII', -1); | ||
| } | ||
|
|
||
| if (!defined("FTP_BINARY")) | ||
| if (!defined('FTP_BINARY')) | ||
| { | ||
| define("FTP_BINARY", 1); | ||
| define('FTP_BINARY', 1); | ||
| } | ||
|
|
||
| if (!defined("FTP_ASCII")) | ||
| if (!defined('FTP_ASCII')) | ||
| { | ||
| define("FTP_ASCII", 0); | ||
| define('FTP_ASCII', 0); | ||
| } | ||
|
|
||
| if (!defined('FTP_NATIVE')) | ||
|
|
@@ -94,27 +94,27 @@ class JClientFtp | |
| * @since 12.1 | ||
| */ | ||
| protected $_autoAscii = array( | ||
| "asp", | ||
| "bat", | ||
| "c", | ||
| "cpp", | ||
| "csv", | ||
| "h", | ||
| "htm", | ||
| "html", | ||
| "shtml", | ||
| "ini", | ||
| "inc", | ||
| "log", | ||
| "php", | ||
| "php3", | ||
| "pl", | ||
| "perl", | ||
| "sh", | ||
| "sql", | ||
| "txt", | ||
| "xhtml", | ||
| "xml", | ||
| 'asp', | ||
| 'bat', | ||
| 'c', | ||
| 'cpp', | ||
| 'csv', | ||
| 'h', | ||
| 'htm', | ||
| 'html', | ||
| 'shtml', | ||
| 'ini', | ||
| 'inc', | ||
| 'log', | ||
| 'php', | ||
| 'php3', | ||
| 'pl', | ||
| 'perl', | ||
| 'sh', | ||
| 'sql', | ||
| 'txt', | ||
| 'xhtml', | ||
| 'xml', | ||
| ); | ||
|
|
||
| /** | ||
|
|
@@ -194,7 +194,7 @@ public function __destruct() | |
| */ | ||
| public static function getInstance($host = '127.0.0.1', $port = '21', array $options = array(), $user = null, $pass = null) | ||
| { | ||
| $signature = $user . ':' . $pass . '@' . $host . ":" . $port; | ||
| $signature = $user . ':' . $pass . '@' . $host . ':' . $port; | ||
|
|
||
| // Create a new instance, or set the options of an existing one | ||
| if (!isset(static::$instances[$signature]) || !is_object(static::$instances[$signature])) | ||
|
|
@@ -428,7 +428,7 @@ public function pwd() | |
| preg_match('/"[^"\r\n]*"/', $this->_response, $match); | ||
|
|
||
| // Return the cleaned path | ||
| return preg_replace("/\"/", "", $match[0]); | ||
| return preg_replace("/\"/", '', $match[0]); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -914,7 +914,7 @@ public function read($remote, &$buffer) | |
| $os = 'WIN'; | ||
| } | ||
|
|
||
| $buffer = preg_replace("/" . CRLF . "/", $this->_lineEndings[$os], $buffer); | ||
| $buffer = preg_replace('/' . CRLF . '/', $this->_lineEndings[$os], $buffer); | ||
| } | ||
|
|
||
| if (!$this->_verifyResponse(226)) | ||
|
|
@@ -966,7 +966,7 @@ public function get($local, $remote) | |
| $this->_mode($mode); | ||
|
|
||
| // Check to see if the local file can be opened for writing | ||
| $fp = fopen($local, "wb"); | ||
| $fp = fopen($local, 'wb'); | ||
|
|
||
| if (!$fp) | ||
| { | ||
|
|
@@ -1060,7 +1060,7 @@ public function store($local, $remote = null) | |
| // Check to see if the local file exists and if so open it for reading | ||
| if (@ file_exists($local)) | ||
| { | ||
| $fp = fopen($local, "rb"); | ||
| $fp = fopen($local, 'rb'); | ||
|
|
||
| if (!$fp) | ||
| { | ||
|
|
@@ -1111,7 +1111,7 @@ public function store($local, $remote = null) | |
|
|
||
| $line = substr($line, $result); | ||
| } | ||
| while ($line != ""); | ||
| while ($line != ''); | ||
| } | ||
|
|
||
| fclose($fp); | ||
|
|
@@ -1202,7 +1202,7 @@ public function write($remote, $buffer) | |
|
|
||
| $buffer = substr($buffer, $result); | ||
| } | ||
| while ($buffer != ""); | ||
| while ($buffer != ''); | ||
|
|
||
| // Close the data connection port [Data transfer complete] | ||
| fclose($this->_dataconn); | ||
|
|
@@ -1453,7 +1453,7 @@ public function listNames($path = null) | |
| return false; | ||
| } | ||
|
|
||
| $data = preg_split("/[" . CRLF . "]+/", $data, -1, PREG_SPLIT_NO_EMPTY); | ||
| $data = preg_split('/[' . CRLF . ']+/', $data, -1, PREG_SPLIT_NO_EMPTY); | ||
| $data = preg_replace('#^' . preg_quote(substr($path, 1), '#') . '[/\\\\]?#', '', $data); | ||
|
|
||
| if ($keys = array_merge(array_keys($data, '.'), array_keys($data, '..'))) | ||
|
|
@@ -1612,19 +1612,19 @@ public function listDetails($path = null, $type = 'all') | |
|
|
||
| if (@preg_match($regexp, $file, $regs)) | ||
| { | ||
| $fType = (int) strpos("-dl", $regs[1]{0}); | ||
| $fType = (int) strpos('-dl', $regs[1]{0}); | ||
|
|
||
| // $tmp_array['line'] = $regs[0]; | ||
| $tmp_array['type'] = $fType; | ||
| $tmp_array['type'] = $fType; | ||
| $tmp_array['rights'] = $regs[1]; | ||
|
|
||
| // $tmp_array['number'] = $regs[2]; | ||
| $tmp_array['user'] = $regs[3]; | ||
| $tmp_array['user'] = $regs[3]; | ||
| $tmp_array['group'] = $regs[4]; | ||
| $tmp_array['size'] = $regs[5]; | ||
| $tmp_array['date'] = @date("m-d", strtotime($regs[6])); | ||
| $tmp_array['time'] = $regs[7]; | ||
| $tmp_array['name'] = $regs[9]; | ||
| $tmp_array['size'] = $regs[5]; | ||
| $tmp_array['date'] = @date('m-d', strtotime($regs[6])); | ||
| $tmp_array['time'] = $regs[7]; | ||
| $tmp_array['name'] = $regs[9]; | ||
| } | ||
|
|
||
| // If we just want files, do not add a folder | ||
|
|
@@ -1739,7 +1739,7 @@ protected function _verifyResponse($expected) | |
| { | ||
| $this->_response .= fgets($this->_conn, 4096); | ||
| } | ||
| while (!preg_match("/^([0-9]{3})(-(.*" . CRLF . ")+\\1)? [^" . CRLF . "]+" . CRLF . "$/", $this->_response, $parts) && time() < $endTime); | ||
| while (!preg_match('/^([0-9]{3})(-(.*' . CRLF . ")+\\1)? [^" . CRLF . ']+' . CRLF . "$/", $this->_response, $parts) && time() < $endTime); | ||
|
|
||
| // Catch a timeout or bad response | ||
| if (!isset($parts[1])) | ||
|
|
@@ -1813,7 +1813,7 @@ protected function _passive() | |
| { | ||
| $this->_response .= fgets($this->_conn, 4096); | ||
| } | ||
| while (!preg_match("/^([0-9]{3})(-(.*" . CRLF . ")+\\1)? [^" . CRLF . "]+" . CRLF . "$/", $this->_response, $parts) && time() < $endTime); | ||
| while (!preg_match('/^([0-9]{3})(-(.*' . CRLF . ")+\\1)? [^" . CRLF . ']+' . CRLF . "$/", $this->_response, $parts) && time() < $endTime); | ||
|
||
|
|
||
| // Catch a timeout or bad response | ||
| if (!isset($parts[1])) | ||
|
|
@@ -1917,7 +1917,7 @@ protected function _mode($mode) | |
| { | ||
| if ($mode == FTP_BINARY) | ||
| { | ||
| if (!$this->_putCmd("TYPE I", 200)) | ||
| if (!$this->_putCmd('TYPE I', 200)) | ||
| { | ||
| JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MODE_BINARY', $this->_response), JLog::WARNING, 'jerror'); | ||
|
|
||
|
|
@@ -1926,7 +1926,7 @@ protected function _mode($mode) | |
| } | ||
| else | ||
| { | ||
| if (!$this->_putCmd("TYPE A", 200)) | ||
| if (!$this->_putCmd('TYPE A', 200)) | ||
| { | ||
| JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MODE_ASCII', $this->_response), JLog::WARNING, 'jerror'); | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
missed one here