@@ -55,20 +55,20 @@ |
||
55 | 55 | * @param $uid |
56 | 56 | * @return string |
57 | 57 | */ |
58 | - public static function getNameByUid($uid){ |
|
58 | + public static function getNameByUid($uid) { |
|
59 | 59 | $um = \OC::$server->getUserManager(); |
60 | 60 | $u = $um->get($uid); |
61 | 61 | return $u->getDisplayName(); |
62 | 62 | } |
63 | 63 | |
64 | - public static function getDirContents($dir, &$results = array()){ |
|
64 | + public static function getDirContents($dir, &$results = array()) { |
|
65 | 65 | $files = scandir($dir); |
66 | 66 | |
67 | - foreach($files as $value){ |
|
68 | - $path = realpath($dir.DIRECTORY_SEPARATOR.$value); |
|
69 | - if(!is_dir($path)) { |
|
67 | + foreach ($files as $value) { |
|
68 | + $path = realpath($dir . DIRECTORY_SEPARATOR . $value); |
|
69 | + if (!is_dir($path)) { |
|
70 | 70 | $results[] = $path; |
71 | - } else if($value != "." && $value != "..") { |
|
71 | + } else if ($value != "." && $value != "..") { |
|
72 | 72 | Utils::getDirContents($path, $results); |
73 | 73 | $results[] = $path; |
74 | 74 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public function getLanguageStrings() { |
42 | 42 | $translations = array( |
43 | 43 | // js/app/controllers/bookmarklet.js |
44 | - 'generating.sharing.keys' => $this->trans->t('Generating sharing keys ( %s / 2)','%step'), |
|
44 | + 'generating.sharing.keys' => $this->trans->t('Generating sharing keys ( %s / 2)', '%step'), |
|
45 | 45 | 'invalid.vault.key' => $this->trans->t('Incorrect vault password!'), |
46 | 46 | 'password.do.not.match' => $this->trans->t('Passwords do not match'), |
47 | 47 | 'general' => $this->trans->t('General'), |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @NoCSRFRequired |
58 | 58 | */ |
59 | 59 | public function getSingleIcon($base64Url) { |
60 | - $url = base64_decode(str_replace('_','/', $base64Url)); |
|
60 | + $url = base64_decode(str_replace('_', '/', $base64Url)); |
|
61 | 61 | if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
62 | 62 | $url = "http://" . $url; |
63 | 63 | } |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | $icon = new IconService($url); |
67 | 67 | |
68 | 68 | if ($icon->icoExists) { |
69 | - $icon_json['type']= $icon->icoType; |
|
70 | - $icon_json['content']= base64_encode($icon->icoData); |
|
69 | + $icon_json['type'] = $icon->icoType; |
|
70 | + $icon_json['content'] = base64_encode($icon->icoData); |
|
71 | 71 | return new JSONResponse($icon_json); |
72 | 72 | } |
73 | 73 | |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | * @NoCSRFRequired |
80 | 80 | */ |
81 | 81 | public function getIcon($base64Url, $credentialId) { |
82 | - $url = base64_decode(str_replace('_','/', $base64Url)); |
|
82 | + $url = base64_decode(str_replace('_', '/', $base64Url)); |
|
83 | 83 | |
84 | - if($credentialId) { |
|
84 | + if ($credentialId) { |
|
85 | 85 | try { |
86 | 86 | $credential = $this->credentialService->getCredentialById($credentialId, $this->userId); |
87 | 87 | $credential = $credential->jsonSerialize(); |
88 | - } catch (DoesNotExistException $e){ |
|
88 | + } catch (DoesNotExistException $e) { |
|
89 | 89 | // Credential is not found, continue |
90 | 90 | $credential = false; |
91 | 91 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | ]; |
112 | 112 | $credential['icon'] = json_encode($iconData); |
113 | 113 | try { |
114 | - if($credential) { |
|
114 | + if ($credential) { |
|
115 | 115 | $this->credentialService->updateCredential($credential); |
116 | 116 | } |
117 | 117 | } catch (DriverException $exception) { |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | $pack = explode('/', $path[1])[2]; |
153 | 153 | $mime = mime_content_type($iconPath); |
154 | 154 | //print_r($path); |
155 | - if($mime !== 'directory') { |
|
155 | + if ($mime !== 'directory') { |
|
156 | 156 | $icon = []; |
157 | 157 | $icon['mimetype'] = mime_content_type($iconPath); |
158 | 158 | $icon['url'] = $this->urlGenerator->linkTo('passman', $path[1]); |
159 | 159 | $icon['pack'] = $pack; |
160 | - if(!isset($icons[$pack])){ |
|
160 | + if (!isset($icons[$pack])) { |
|
161 | 161 | $icons[$pack] = []; |
162 | 162 | } |
163 | 163 | $icons[$pack][] = $icon; |