Skip to content

Commit 2685e14

Browse files
committed
Fixes after code review
1 parent 5364d08 commit 2685e14

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

library/Zend/Db/Adapter/Pdo/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ protected function _quote($value)
293293
return $value;
294294
}
295295
$this->_connect();
296-
return $this->_connection->quote($value ?? '');
296+
return ($value !== null) ? $this->_connection->quote($value) : '""';
297297
}
298298

299299
/**

library/Zend/Db/Select.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,9 @@ protected function _join($type, $name, $cond, $cols, $schema = null)
817817
$tableName = $name;
818818
$correlationName = $this->_uniqueCorrelation($tableName);
819819
}
820-
$tableName = $tableName ?? '';
821820

822821
// Schema from table name overrides schema argument
823-
if (!is_object($tableName) && false !== strpos($tableName, '.')) {
822+
if ($tableName && !is_object($tableName) && (strpos($tableName, '.') !== false)) {
824823
list($schema, $tableName) = explode('.', $tableName);
825824
}
826825

library/Zend/Http/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function getBody()
261261
$transferEncoding = $this->getHeader('transfer-encoding');
262262

263263
// Decode the body if it was transfer-encoded
264-
switch ($transferEncoding ? strtolower($transferEncoding) : '') {
264+
switch (($transferEncoding !== null) ? strtolower($transferEncoding) : '') {
265265

266266
// Handle chunked body
267267
case 'chunked':
@@ -278,7 +278,7 @@ public function getBody()
278278
$contentEncoding = $this->getHeader('content-encoding');
279279

280280
// Decode any content-encoding (gzip or deflate) if needed
281-
switch ($contentEncoding ? strtolower($contentEncoding) : '') {
281+
switch (($contentEncoding !== null) ? strtolower($contentEncoding) : '') {
282282

283283
// Handle gzip encoding
284284
case 'gzip':

library/Zend/Locale/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ public static function getContent($locale, $path, $value = false)
982982
if (is_array($value)) {
983983
$val = implode('_' , $value);
984984
}
985-
$val = $val ? urlencode($val) : '';
985+
$val = ($val !== null) ? urlencode($val) : '';
986986
$id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val);
987987
if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
988988
return unserialize($result);

library/Zend/Oauth/Http/Utility.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public function generateTimestamp()
210210
*/
211211
public static function urlEncode($value)
212212
{
213-
return $value ? str_replace('%7E', '~', rawurlencode($value)) : '';
213+
return ($value !== null) ?
214+
str_replace('%7E', '~', rawurlencode($value)) : '';
214215
}
215216
}

library/Zend/Validate/File/Extension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ public function setCase($case)
121121
*/
122122
public function getExtension()
123123
{
124-
$extension = explode(',', $this->_extension);
125-
126-
return $extension;
124+
return ($this->_extension !== null) ? explode(',', $this->_extension) : [''];
127125
}
128126

129127
/**

0 commit comments

Comments
 (0)