@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function createRecord($name, $ip, $domain = 'somedomainnameyouwishtoupgrade.de', $type = 'A') |
| 33 | 33 | { |
| 34 | 34 | if (strpos($name, $domain) === false) { |
| 35 | - $name = $name.".".$domain; |
|
| 35 | + $name = $name . "." . $domain; |
|
| 36 | 36 | } |
| 37 | 37 | try { |
| 38 | 38 | $result = $this->call('nameserver', 'createRecord', array( |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function updateRecord($id, $ip) |
| 51 | 51 | { |
| 52 | - $result = $this->call('nameserver','updateRecord', array( |
|
| 52 | + $result = $this->call('nameserver', 'updateRecord', array( |
|
| 53 | 53 | 'id' => $id, |
| 54 | 54 | 'content' => $ip |
| 55 | 55 | )); |
@@ -143,25 +143,33 @@ |
||
| 143 | 143 | |
| 144 | 144 | private function _base32Decode($secret) |
| 145 | 145 | { |
| 146 | - if (empty($secret)) return ''; |
|
| 146 | + if (empty($secret)) { |
|
| 147 | + return ''; |
|
| 148 | + } |
|
| 147 | 149 | |
| 148 | 150 | $base32chars = $this->_getBase32LookupTable(); |
| 149 | 151 | $base32charsFlipped = array_flip($base32chars); |
| 150 | 152 | |
| 151 | 153 | $paddingCharCount = substr_count($secret, $base32chars[32]); |
| 152 | 154 | $allowedValues = array(6, 4, 3, 1, 0); |
| 153 | - if (!in_array($paddingCharCount, $allowedValues)) return false; |
|
| 155 | + if (!in_array($paddingCharCount, $allowedValues)) { |
|
| 156 | + return false; |
|
| 157 | + } |
|
| 154 | 158 | for ($i = 0; $i < 4; $i++) { |
| 155 | 159 | if ($paddingCharCount == $allowedValues[$i] && |
| 156 | 160 | substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i]) |
| 157 | - ) return false; |
|
| 161 | + ) { |
|
| 162 | + return false; |
|
| 163 | + } |
|
| 158 | 164 | } |
| 159 | 165 | $secret = str_replace('=', '', $secret); |
| 160 | 166 | $secret = str_split($secret); |
| 161 | 167 | $binaryString = ""; |
| 162 | 168 | for ($i = 0; $i < count($secret); $i = $i + 8) { |
| 163 | 169 | $x = ""; |
| 164 | - if (!in_array($secret[$i], $base32chars)) return false; |
|
| 170 | + if (!in_array($secret[$i], $base32chars)) { |
|
| 171 | + return false; |
|
| 172 | + } |
|
| 165 | 173 | for ($j = 0; $j < 8; $j++) { |
| 166 | 174 | $x .= str_pad(base_convert(@$base32charsFlipped[@$secret[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT); |
| 167 | 175 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | //service |
| 23 | 23 | $loader = new YamlFileLoader( |
| 24 | 24 | $container, |
| 25 | - new FileLocator(__DIR__.'/../Resources/config') |
|
| 25 | + new FileLocator(__DIR__ . '/../Resources/config') |
|
| 26 | 26 | ); |
| 27 | 27 | $loader->load('services.yml'); |
| 28 | 28 | } |