use (int) instead of intval for performance reasons

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2017-02-22 15:14:36 +01:00
parent decdb06e89
commit 59f4ffb9a3
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
1 changed files with 2 additions and 2 deletions

View File

@ -429,13 +429,13 @@ class ShareesAPIController extends OCSController {
public function search($search = '', $itemType = null, $page = 1, $perPage = 200, $shareType = null, $lookup = true) {
// only search for string larger than a given threshold
$threshold = intval($this->config->getSystemValue('sharing.minSearchStringLength', 0));
$threshold = (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0);
if (strlen($search) < $threshold) {
return new DataResponse($this->result);
}
// never return more than the max. number of results configured in the config.php
$maxResults = intval($this->config->getSystemValue('sharing.maxAutocompleteResults', 0));
$maxResults = (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0);
if ($maxResults > 0) {
$perPage = min($perPage, $maxResults);
}