Changeset 4388 in subversion
- Timestamp:
- Jan 4, 2011 5:48:27 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap_generic.php
r4384 r4388 372 372 } 373 373 374 function getCapability($name) 375 { 374 private function hasCapability($name) 375 { 376 if (empty($this->capability) || $name == '') { 377 return false; 378 } 379 376 380 if (in_array($name, $this->capability)) { 377 381 return true; 382 } 383 else if (strpos($name, '=')) { 384 return false; 385 } 386 387 $result = array(); 388 foreach ($this->capability as $cap) { 389 $entry = explode('=', $cap); 390 if ($entry[0] == $name) { 391 $result[] = $entry[1]; 392 } 393 } 394 395 return !empty($result) ? $result : false; 396 } 397 398 /** 399 * Capabilities checker 400 * 401 * @param string $name Capability name 402 * 403 * @return mixed Capability values array for key=value pairs, true/false for others 404 */ 405 function getCapability($name) 406 { 407 $result = $this->hasCapability($name); 408 409 if (!empty($result)) { 410 return $result; 378 411 } 379 412 else if ($this->capability_readed) { … … 391 424 $this->capability_readed = true; 392 425 393 if (in_array($name, $this->capability)) { 394 return true; 395 } 396 397 return false; 426 return $this->hasCapability($name); 398 427 } 399 428
Note: See TracChangeset
for help on using the changeset viewer.
