Changeset 817
- Timestamp:
- Aug 20, 2024 4:21:17 AM (4 weeks ago)
- Location:
- trunk/lib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Cache.inc.php
r638 r817 63 63 // How long in seconds before items in the cache are considered expired. 64 64 // When the cache expires, Cache->get() returns null. 65 'expires' => 3600,65 'expires' => 900, 66 66 ); 67 67 -
trunk/lib/ImageThumb.inc.php
r775 r817 252 252 * 253 253 * @access public 254 * @param string $key Key to return. See _default_image_specs above for a list. 255 * @param int $index The index in the spec array of the value to retrieve. The first if not specified. 256 * @return mixed Value of requested index. 254 * @param string $key Key to return. See _default_image_specs above for a list. 255 * @param int $index The index in the spec array of the value to retrieve. The first if not specified. 256 * @param string $dest_dir Return the spec matching this dest_dir (if used, the provided $index is ignored). 257 * @return mixed Value of requested $key for the spec selected by $index or $dest_dir. 257 258 * @author Quinn Comendant <quinn@strangecode.com> 258 259 * @version 1.0 259 260 * @since 08 May 2007 15:26:39 260 261 */ 261 public function getSpec($key, $index=null )262 public function getSpec($key, $index=null, $dest_dir=null) 262 263 { 263 264 $index = isset($index) ? $index : 0; 265 if (isset($dest_dir)) { 266 $index = array_search($dest_dir, array_column($this->_image_specs, 'dest_dir')); 267 } 264 268 return $this->_image_specs[$index][$key]; 265 269 } -
trunk/lib/PageNumbers.inc.php
r812 r817 95 95 private function _validNumber($num) 96 96 { 97 if (!isset($num) || '' == $num) {97 if (!isset($num) || '' === $num) { 98 98 return false; 99 99 } -
trunk/lib/Prefs.inc.php
r784 r817 311 311 return false; 312 312 } 313 if ('' == trim($key)) {314 $app->logMsg(sprintf('Key is empty ( along with value:%s)', $val), LOG_NOTICE, __FILE__, __LINE__);313 if ('' === trim($key)) { 314 $app->logMsg(sprintf('Key is empty (val=%s)', $val), LOG_NOTICE, __FILE__, __LINE__); 315 315 return false; 316 316 } … … 529 529 530 530 // User_id must not be empty. 531 if ('' == $this->getParam('user_id')) {531 if ('' === $this->getParam('user_id')) { 532 532 $app->logMsg(sprintf('Cannot load prefs because user_id not set.', null), LOG_WARNING, __FILE__, __LINE__); 533 533 return false; … … 603 603 604 604 // User_id must not be empty. 605 if ('' == $this->getParam('user_id')) {605 if ('' === $this->getParam('user_id')) { 606 606 $app->logMsg(sprintf('Cannot save prefs because user_id not set.', null), LOG_DEBUG, __FILE__, __LINE__); 607 607 return false; -
trunk/lib/Upload.inc.php
r806 r817 182 182 $file_path_name = ''; 183 183 184 if ('' == trim($files['name'][$i])) {184 if ('' === trim($files['name'][$i])) { 185 185 // User may not have attached a file. 186 186 $app->logMsg(sprintf('Skipping file %s with empty name', $i), LOG_DEBUG, __FILE__, __LINE__); -
trunk/lib/Utilities.inc.php
r816 r817 253 253 $app =& App::getInstance(); 254 254 255 if ('' == $text) {255 if ('' === $text) { 256 256 return ''; 257 257 } … … 999 999 // If the prefix is empty, use the $key as the name of the first dimension of the "array". 1000 1000 // ...otherwise, append the key as a new dimension of the "array". 1001 $new_prefix = ('' == $prefix) ? urlencode($key) : $prefix . '[' . urlencode($key) . ']';1001 $new_prefix = ('' === $prefix) ? urlencode($key) : $prefix . '[' . urlencode($key) . ']'; 1002 1002 // Enter recursion. 1003 1003 urlEncodeArray($val, $new_prefix, false); … … 1390 1390 $app =& App::getInstance(); 1391 1391 1392 if ('' == trim($val)) {1392 if ('' === trim($val)) { 1393 1393 $app->logMsg(sprintf('Cannot add signature to an empty string.', null), LOG_INFO, __FILE__, __LINE__); 1394 1394 return ''; … … 1439 1439 // Strip the value from the signed value. 1440 1440 $val = removeSignature($signed_val); 1441 if ('' == $val) {1441 if ('' === $val) { 1442 1442 // Removing the signature failed because it was empty or did not contain a hyphen. 1443 1443 $app->logMsg(sprintf('Invalid signature ("%s" is not a valid signed value).', $signed_val), LOG_DEBUG, __FILE__, __LINE__); … … 1593 1593 function ipInRange($addr, $networks) 1594 1594 { 1595 if (null == $addr || '' == trim($addr)) {1595 if (null == $addr || '' === trim($addr)) { 1596 1596 return false; 1597 1597 } -
trunk/lib/Validator.inc.php
r807 r817 107 107 { 108 108 $app =& App::getInstance(); 109 if ('' == trim((string)$val) || is_string($val)) {109 if ('' === trim((string)$val) || is_string($val)) { 110 110 return true; 111 111 } else { … … 127 127 { 128 128 $app =& App::getInstance(); 129 if ('' == trim((string)$val) || is_numeric($val)) {129 if ('' === trim((string)$val) || is_numeric($val)) { 130 130 return true; 131 131 } else { … … 149 149 $app =& App::getInstance(); 150 150 $pattern = $negative_ok ? '/^-?[[:digit:]]+$/' : '/^[[:digit:]]+$/'; 151 if ('' == trim((string)$val) || (is_numeric($val) && preg_match($pattern, $val))) {151 if ('' === trim((string)$val) || (is_numeric($val) && preg_match($pattern, $val))) { 152 152 return true; 153 153 } else { … … 173 173 $app =& App::getInstance(); 174 174 $pattern = $negative_ok ? '/^-?[[:digit:]]*(?:\.?[[:digit:]]+)$/' : '/^[[:digit:]]*(?:\.?[[:digit:]]+)$/'; 175 if ('' == trim((string)$val) || (is_numeric($val) && preg_match($pattern, $val))) {175 if ('' === trim((string)$val) || (is_numeric($val) && preg_match($pattern, $val))) { 176 176 return true; 177 177 } else { … … 198 198 { 199 199 $app =& App::getInstance(); 200 if ('' == trim((string)$val)) {200 if ('' === trim((string)$val)) { 201 201 return true; 202 202 } … … 229 229 { 230 230 $app =& App::getInstance(); 231 if ((is_string($val) && '' == trim((string)$val)) || is_array($val)) {231 if ((is_string($val) && '' === trim((string)$val)) || is_array($val)) { 232 232 return true; 233 233 } else { … … 296 296 { 297 297 $app =& App::getInstance(); 298 if ('' == trim((string)$val) || (is_numeric($val) && $val >= $min && $val <= $max)) {298 if ('' === trim((string)$val) || (is_numeric($val) && $val >= $min && $val <= $max)) { 299 299 return true; 300 300 } else { … … 535 535 if (is_array($_FILES[$form_name]['name'])) { 536 536 foreach($_FILES[$form_name]['name'] as $f) { 537 if ('' == $f) {537 if ('' === $f) { 538 538 $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($_FILES)), $type, $file, $line); 539 539 return false; … … 541 541 } 542 542 } else { 543 if ('' == $_FILES[$form_name]['name']) {543 if ('' === $_FILES[$form_name]['name']) { 544 544 $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($_FILES)), $type, $file, $line); 545 545 return false;
Note: See TracChangeset
for help on using the changeset viewer.