@@ -104,16 +104,16 @@ |
||
104 | 104 | /** @var $entityManager Doctrine\ORM\EntityManager */ |
105 | 105 | $entityManager = ServiceUtil::get('doctrine.orm.default_entity_manager'); |
106 | 106 | $qb = $entityManager->createQueryBuilder() |
107 | - ->select('t') |
|
108 | - ->from('ZikulaThemeModule:ThemeEntity', 't'); |
|
107 | + ->select('t') |
|
108 | + ->from('ZikulaThemeModule:ThemeEntity', 't'); |
|
109 | 109 | |
110 | 110 | if ($state != self::STATE_ALL) { |
111 | 111 | $qb->andWhere('t.state = :state') |
112 | - ->setParameter('state', $state); |
|
112 | + ->setParameter('state', $state); |
|
113 | 113 | } |
114 | 114 | if ($type != self::TYPE_ALL) { |
115 | 115 | $qb->andWhere('t.type = :type') |
116 | - ->setParameter('type', $type); |
|
116 | + ->setParameter('type', $type); |
|
117 | 117 | } |
118 | 118 | switch ($filter) { |
119 | 119 | case self::FILTER_USER: |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $bundleRelativePath = str_replace('\\', '/', $bundleRelativePath); |
299 | 299 | } |
300 | 300 | $paths[] = null === $theme ? |
301 | - "themes/$themeName/style/$osmodname" : $bundleRelativePath.'/Resources/css/'.$theme->getName(); |
|
301 | + "themes/$themeName/style/$osmodname" : $bundleRelativePath . '/Resources/css/' . $theme->getName(); |
|
302 | 302 | |
303 | 303 | // module directory |
304 | 304 | $modinfo = ModUtil::getInfoFromName($modname); |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $dir = ModUtil::getModuleBaseDir($modname); |
309 | 309 | $bundleRelativePath = substr($module->getPath(), strpos($module->getPath(), $dir), strlen($module->getPath())); |
310 | 310 | $bundleRelativePath = str_replace('\\', '/', $bundleRelativePath); |
311 | - $paths[] = $bundleRelativePath."/Resources/public/css"; |
|
311 | + $paths[] = $bundleRelativePath . "/Resources/public/css"; |
|
312 | 312 | } |
313 | 313 | $paths[] = "modules/$osmoddir/style"; |
314 | 314 | $paths[] = "system/$osmoddir/style"; |
@@ -108,8 +108,8 @@ |
||
108 | 108 | $multiple = $multipleSize > 1 ? 'multiple="multiple"' : ''; |
109 | 109 | $multipleSize = $multipleSize > 1 ? "size=\"$multipleSize\"" : ''; |
110 | 110 | $submit = $submit ? 'onchange="this.form.submit();"' : ''; |
111 | - $required = ($required) ? 'required="required" oninvalid="this.setCustomValidity(\''.__('Please select an item in the list.').'\');" onchange="this.setCustomValidity(\'\');" onblur="this.checkValidity();"' : ''; |
|
112 | - $title = (is_null($title)) ? '' : 'title="'.$title.'" x-moz-errormessage="'.$title.'"'; |
|
111 | + $required = ($required) ? 'required="required" oninvalid="this.setCustomValidity(\'' . __('Please select an item in the list.') . '\');" onchange="this.setCustomValidity(\'\');" onblur="this.checkValidity();"' : ''; |
|
112 | + $title = (is_null($title)) ? '' : 'title="' . $title . '" x-moz-errormessage="' . $title . '"'; |
|
113 | 113 | |
114 | 114 | $html = "<select name=\"$name\" id=\"$id\" class=\"$class\" $multipleSize $multiple $submit $disabled $required $title>"; |
115 | 115 |
@@ -184,7 +184,7 @@ |
||
184 | 184 | throw new \Exception(__f("Error! Invalid 'base_obj_type' specification '%s'.", $base_obj_type)); |
185 | 185 | } |
186 | 186 | |
187 | - $prefix = (string) $prefix; |
|
187 | + $prefix = (string)$prefix; |
|
188 | 188 | |
189 | 189 | if (strpos($base_obj_type, '_') !== false) { |
190 | 190 | $c = $base_obj_type; |
@@ -894,7 +894,7 @@ |
||
894 | 894 | throw new \Exception(__f("Non-existing field [%s] received", $column)); |
895 | 895 | } |
896 | 896 | |
897 | - $where = ''; |
|
897 | + $where = ''; |
|
898 | 898 | if ($filter) { |
899 | 899 | $filter = $this->cleanFilter($filter); |
900 | 900 | $where = DBUtil::_checkWhereClause($this->genFilter($filter)); |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | list(, $tab) = explode(' ', $sql); |
294 | 294 | } |
295 | 295 | if (strpos($sql, 'delete') === 0) { |
296 | - list(, , $tab) = explode(' ', $sql); |
|
296 | + list(,, $tab) = explode(' ', $sql); |
|
297 | 297 | } |
298 | 298 | if ($tab && strpos($tab, 'session_info') === false) { |
299 | 299 | self::flushCache($tab); |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | } |
753 | 753 | $vArray[] = self::_formatForStore($str); |
754 | 754 | } else { |
755 | - $vArray[] = self::_typesafeQuotedValue($table, $key, $object[$key]); |
|
755 | + $vArray[] = self::_typesafeQuotedValue($table, $key, $object[$key]); |
|
756 | 756 | } |
757 | 757 | } |
758 | 758 | } else { |
@@ -1995,7 +1995,7 @@ discard block |
||
1995 | 1995 | |
1996 | 1996 | // process the where depending of the operator |
1997 | 1997 | if ($op == 'AND') { |
1998 | - $where[] = "obj_id IN (SELECT {$prefix}obj_id FROM $catmapobjtbl table$n WHERE {$prefix}reg_id = '".DataUtil::formatForStore($propids[$property])."' AND $wherecat)"; |
|
1998 | + $where[] = "obj_id IN (SELECT {$prefix}obj_id FROM $catmapobjtbl table$n WHERE {$prefix}reg_id = '" . DataUtil::formatForStore($propids[$property]) . "' AND $wherecat)"; |
|
1999 | 1999 | } else { |
2000 | 2000 | $where[] = "(reg_id='" . DataUtil::formatForStore($propids[$property]) . "' AND $wherecat)"; |
2001 | 2001 | } |
@@ -2312,7 +2312,7 @@ discard block |
||
2312 | 2312 | */ |
2313 | 2313 | public static function selectObjectSum($table, $column, $where = '', $categoryFilter = null, $subquery = null) |
2314 | 2314 | { |
2315 | - $key = $column . $where. serialize($categoryFilter) . $subquery; |
|
2315 | + $key = $column . $where . serialize($categoryFilter) . $subquery; |
|
2316 | 2316 | $sum = self::getCache($table, $key); |
2317 | 2317 | if ($sum !== false) { |
2318 | 2318 | return $sum; |
@@ -2361,7 +2361,7 @@ discard block |
||
2361 | 2361 | */ |
2362 | 2362 | public static function selectObjectCount($table, $where = '', $column = '1', $distinct = false, $categoryFilter = null, $subquery = null) |
2363 | 2363 | { |
2364 | - $key = $column . $where. (int)$distinct . serialize($categoryFilter) . $subquery; |
|
2364 | + $key = $column . $where . (int)$distinct . serialize($categoryFilter) . $subquery; |
|
2365 | 2365 | $sum = self::getCache($table, $key); |
2366 | 2366 | if ($sum !== false) { |
2367 | 2367 | return $sum; |
@@ -2518,7 +2518,7 @@ discard block |
||
2518 | 2518 | $tables = self::getTables(); |
2519 | 2519 | $tableName = $tables[$table]; |
2520 | 2520 | $columns = $tables["{$table}_column"]; |
2521 | - $fieldName = isset($columns[$field]) ? 'tbl.'.$columns[$field] : $field; |
|
2521 | + $fieldName = isset($columns[$field]) ? 'tbl.' . $columns[$field] : $field; |
|
2522 | 2522 | |
2523 | 2523 | $sqlJoinArray = self::_processJoinArray($table, $joinInfo); |
2524 | 2524 | $sqlJoin = $sqlJoinArray[0]; |
@@ -2777,7 +2777,7 @@ discard block |
||
2777 | 2777 | //$dst = ($distinct ? 'DISTINCT' : ''); |
2778 | 2778 | $sqlStart = "SELECT COUNT(*) "; |
2779 | 2779 | $sqlFrom = "FROM $tableName AS tbl "; |
2780 | - $sqlGroupBy = (empty($sqlJoinArray[3])) ? '' : 'GROUP BY '.implode(', ', $sqlJoinArray[3]); |
|
2780 | + $sqlGroupBy = (empty($sqlJoinArray[3])) ? '' : 'GROUP BY ' . implode(', ', $sqlJoinArray[3]); |
|
2781 | 2781 | |
2782 | 2782 | $sql = "$sqlStart $sqlJoinFieldList $sqlFrom $sqlJoin $where $sqlGroupBy"; |
2783 | 2783 | $res = self::executeSQL($sql); |
@@ -3056,9 +3056,9 @@ discard block |
||
3056 | 3056 | // we have a {$tablename}_column_def array as defined in tables.php. This is a real array, not a string. |
3057 | 3057 | // The format is like "C(24) NOTNULL DEFAULT ''" which means we have to prepend the field name now |
3058 | 3058 | $typemap = [ |
3059 | - 'B' => 'blob', // NOTE: not supported in Doctrine 2 |
|
3059 | + 'B' => 'blob', // NOTE: not supported in Doctrine 2 |
|
3060 | 3060 | 'C' => 'string', |
3061 | - 'C2' => 'blob', // NOTE: not supported in Doctrine 2 |
|
3061 | + 'C2' => 'blob', // NOTE: not supported in Doctrine 2 |
|
3062 | 3062 | 'D' => 'date', |
3063 | 3063 | 'F' => 'float', |
3064 | 3064 | 'I' => 'integer', |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | if (self::$safe_mode) self::$allow_overlong = true; |
40 | 40 | if (!in_array($from, self::$mechs)) throw new Exception('Invalid input format specified'); |
41 | 41 | if (!in_array($to, self::$mechs)) throw new Exception('Invalid output format specified'); |
42 | - if ($from != 'ucs4array') eval('$data = self::'.$from.'_ucs4array($data);'); |
|
43 | - if ($to != 'ucs4array') eval('$data = self::ucs4array_'.$to.'($data);'); |
|
42 | + if ($from != 'ucs4array') eval('$data = self::' . $from . '_ucs4array($data);'); |
|
43 | + if ($to != 'ucs4array') eval('$data = self::ucs4array_' . $to . '($data);'); |
|
44 | 44 | return $data; |
45 | 45 | } |
46 | 46 | |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | ++$out_len; |
67 | 67 | if ('add' == $mode) { |
68 | 68 | if (self::$safe_mode) { |
69 | - $output[$out_len-2] = self::$safe_char; |
|
69 | + $output[$out_len - 2] = self::$safe_char; |
|
70 | 70 | $mode = 'next'; |
71 | 71 | } else { |
72 | - throw new Exception('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
72 | + throw new Exception('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | continue; |
@@ -93,16 +93,16 @@ discard block |
||
93 | 93 | ++$out_len; |
94 | 94 | continue; |
95 | 95 | } else { |
96 | - throw new Exception('This might be UTF-8, but I don\'t understand it at byte '.$k); |
|
96 | + throw new Exception('This might be UTF-8, but I don\'t understand it at byte ' . $k); |
|
97 | 97 | } |
98 | - if ($inp_len-$k-$next_byte < 2) { |
|
98 | + if ($inp_len - $k - $next_byte < 2) { |
|
99 | 99 | $output[$out_len] = self::$safe_char; |
100 | 100 | $mode = 'no'; |
101 | 101 | continue; |
102 | 102 | } |
103 | 103 | |
104 | 104 | if ('add' == $mode) { |
105 | - $output[$out_len] = (int) $v; |
|
105 | + $output[$out_len] = (int)$v; |
|
106 | 106 | ++$out_len; |
107 | 107 | continue; |
108 | 108 | } |
@@ -111,21 +111,21 @@ discard block |
||
111 | 111 | if (!self::$allow_overlong && $test == 'range') { |
112 | 112 | $test = 'none'; |
113 | 113 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
114 | - throw new Exception('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
|
114 | + throw new Exception('Bogus UTF-8 character detected (out of legal range) at byte ' . $k); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx |
118 | - $v = ($v-128) << ($next_byte*6); |
|
119 | - $output[($out_len-1)] += $v; |
|
118 | + $v = ($v - 128) << ($next_byte * 6); |
|
119 | + $output[($out_len - 1)] += $v; |
|
120 | 120 | --$next_byte; |
121 | 121 | } else { |
122 | 122 | if (self::$safe_mode) { |
123 | - $output[$out_len-1] = ord(self::$safe_char); |
|
123 | + $output[$out_len - 1] = ord(self::$safe_char); |
|
124 | 124 | $k--; |
125 | 125 | $mode = 'next'; |
126 | 126 | continue; |
127 | 127 | } else { |
128 | - throw new Exception('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
128 | + throw new Exception('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | if ($next_byte < 0) { |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | if ($v < 128) { // 7bit are transferred literally |
149 | 149 | $output .= chr($v); |
150 | 150 | } elseif ($v < (1 << 11)) { // 2 bytes |
151 | - $output .= chr(192+($v >> 6)).chr(128+($v & 63)); |
|
151 | + $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
152 | 152 | } elseif ($v < (1 << 16)) { // 3 bytes |
153 | - $output .= chr(224+($v >> 12)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); |
|
153 | + $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
154 | 154 | } elseif ($v < (1 << 21)) { // 4 bytes |
155 | - $output .= chr(240+($v >> 18)).chr(128+(($v >> 12) & 63)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); |
|
155 | + $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
156 | 156 | } elseif (self::$safe_mode) { |
157 | 157 | $output .= self::$safe_char; |
158 | 158 | } else { |
159 | - throw new Exception('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); |
|
159 | + throw new Exception('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | return $output; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | if (0 == ord($c)) continue; // Ignore zero bytes |
181 | 181 | if ('b' == $mode) { |
182 | 182 | // Sequence got terminated |
183 | - if (!preg_match('![A-Za-z0-9/'.preg_quote($sc, '!').']!', $c)) { |
|
183 | + if (!preg_match('![A-Za-z0-9/' . preg_quote($sc, '!') . ']!', $c)) { |
|
184 | 184 | if ('-' == $c) { |
185 | 185 | if ($b64 == '') { |
186 | 186 | $output[$out_len] = ord($sc); |
@@ -233,23 +233,23 @@ discard block |
||
233 | 233 | $is_direct = (false !== $v) ? (0x20 <= $v && $v <= 0x7e && $v != ord($sc)) : true; |
234 | 234 | if ($mode == 'b') { |
235 | 235 | if ($is_direct) { |
236 | - if ($b64 == chr(0).$sc) { |
|
237 | - $output .= $sc.'-'; |
|
236 | + if ($b64 == chr(0) . $sc) { |
|
237 | + $output .= $sc . '-'; |
|
238 | 238 | $b64 = ''; |
239 | 239 | } elseif ($b64) { |
240 | - $output .= $sc.str_replace('=', '', base64_encode($b64)).'-'; |
|
240 | + $output .= $sc . str_replace('=', '', base64_encode($b64)) . '-'; |
|
241 | 241 | $b64 = ''; |
242 | 242 | } |
243 | 243 | $mode = 'd'; |
244 | 244 | } elseif (false !== $v) { |
245 | - $b64 .= chr(($v >> 8) & 255). chr($v & 255); |
|
245 | + $b64 .= chr(($v >> 8) & 255) . chr($v & 255); |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 | if ($mode == 'd' && false !== $v) { |
249 | 249 | if ($is_direct) { |
250 | 250 | $output .= chr($v); |
251 | 251 | } else { |
252 | - $b64 = chr(($v >> 8) & 255). chr($v & 255); |
|
252 | + $b64 = chr(($v >> 8) & 255) . chr($v & 255); |
|
253 | 253 | $mode = 'b'; |
254 | 254 | } |
255 | 255 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | { |
267 | 267 | $output = ''; |
268 | 268 | foreach ($input as $v) { |
269 | - $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); |
|
269 | + $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255); |
|
270 | 270 | } |
271 | 271 | return $output; |
272 | 272 | } |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $out_len++; |
293 | 293 | $output[$out_len] = 0; |
294 | 294 | } |
295 | - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); |
|
295 | + $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4))); |
|
296 | 296 | } |
297 | 297 | return $output; |
298 | 298 | } |
@@ -36,11 +36,21 @@ discard block |
||
36 | 36 | { |
37 | 37 | self::$safe_mode = ($safe_mode) ? true : false; |
38 | 38 | self::$safe_char = ($safe_char) ? $safe_char : 0xFFFC; |
39 | - if (self::$safe_mode) self::$allow_overlong = true; |
|
40 | - if (!in_array($from, self::$mechs)) throw new Exception('Invalid input format specified'); |
|
41 | - if (!in_array($to, self::$mechs)) throw new Exception('Invalid output format specified'); |
|
42 | - if ($from != 'ucs4array') eval('$data = self::'.$from.'_ucs4array($data);'); |
|
43 | - if ($to != 'ucs4array') eval('$data = self::ucs4array_'.$to.'($data);'); |
|
39 | + if (self::$safe_mode) { |
|
40 | + self::$allow_overlong = true; |
|
41 | + } |
|
42 | + if (!in_array($from, self::$mechs)) { |
|
43 | + throw new Exception('Invalid input format specified'); |
|
44 | + } |
|
45 | + if (!in_array($to, self::$mechs)) { |
|
46 | + throw new Exception('Invalid output format specified'); |
|
47 | + } |
|
48 | + if ($from != 'ucs4array') { |
|
49 | + eval('$data = self::'.$from.'_ucs4array($data);'); |
|
50 | + } |
|
51 | + if ($to != 'ucs4array') { |
|
52 | + eval('$data = self::ucs4array_'.$to.'($data);'); |
|
53 | + } |
|
44 | 54 | return $data; |
45 | 55 | } |
46 | 56 | |
@@ -177,7 +187,10 @@ discard block |
||
177 | 187 | |
178 | 188 | for ($k = 0; $k < $inp_len; ++$k) { |
179 | 189 | $c = $input{$k}; |
180 | - if (0 == ord($c)) continue; // Ignore zero bytes |
|
190 | + if (0 == ord($c)) { |
|
191 | + continue; |
|
192 | + } |
|
193 | + // Ignore zero bytes |
|
181 | 194 | if ('b' == $mode) { |
182 | 195 | // Sequence got terminated |
183 | 196 | if (!preg_match('![A-Za-z0-9/'.preg_quote($sc, '!').']!', $c)) { |
@@ -253,7 +266,9 @@ discard block |
||
253 | 266 | $mode = 'b'; |
254 | 267 | } |
255 | 268 | } |
256 | - if (false === $v && $b64 == '') break; |
|
269 | + if (false === $v && $b64 == '') { |
|
270 | + break; |
|
271 | + } |
|
257 | 272 | } |
258 | 273 | return $output; |
259 | 274 | } |
@@ -285,7 +300,9 @@ discard block |
||
285 | 300 | throw new Exception('Input UCS4 string is broken'); |
286 | 301 | } |
287 | 302 | // Empty input - return empty output |
288 | - if (!$inp_len) return $output; |
|
303 | + if (!$inp_len) { |
|
304 | + return $output; |
|
305 | + } |
|
289 | 306 | |
290 | 307 | for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) { |
291 | 308 | if (!($i % 4)) { // Increment output position every 4 input bytes |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | protected $_lcount = 19; |
74 | 74 | protected $_vcount = 21; |
75 | 75 | protected $_tcount = 28; |
76 | - protected $_ncount = 588; // _vcount * _tcount |
|
76 | + protected $_ncount = 588; // _vcount * _tcount |
|
77 | 77 | protected $_scount = 11172; // _lcount * _tcount * _vcount |
78 | 78 | protected $_error = false; |
79 | 79 | protected static $_mb_string_overload = null; |
80 | 80 | // See {@link set_paramter()} for details of how to change the following |
81 | 81 | // settings from within your script / application |
82 | - protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
83 | - protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
84 | - protected $_strict_mode = false; // Behave strict or not |
|
85 | - protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
82 | + protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
83 | + protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
84 | + protected $_strict_mode = false; // Behave strict or not |
|
85 | + protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * the constructor |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | public function get_version() |
109 | 109 | { |
110 | - return $this->version.'-'.$this->sub_version; |
|
110 | + return $this->version . '-' . $this->sub_version; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -241,12 +241,12 @@ discard block |
||
241 | 241 | } |
242 | 242 | } |
243 | 243 | $parsed['host'] = join('.', $arr); |
244 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
245 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
246 | - $parsed['host']. |
|
247 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
248 | - (empty($parsed['path']) ? '' : $parsed['path']). |
|
249 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
244 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')) . |
|
245 | + (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@') . |
|
246 | + $parsed['host'] . |
|
247 | + (empty($parsed['port']) ? '' : ':' . $parsed['port']) . |
|
248 | + (empty($parsed['path']) ? '' : $parsed['path']) . |
|
249 | + (empty($parsed['query']) ? '' : '?' . $parsed['query']) . |
|
250 | 250 | (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
251 | 251 | } else { // parse_url seems to have failed, try without it |
252 | 252 | $arr = explode('.', $input); |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | // The output is UTF-8 by default, other output formats need conversion here |
266 | 266 | // If one time encoding is given, use this, else the objects property |
267 | 267 | switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { |
268 | - case 'utf8': return $return; // break; |
|
269 | - case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
268 | + case 'utf8' : return $return; // break; |
|
269 | + case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
270 | 270 | case 'ucs4_array': return $this->_utf8_to_ucs4($return); // break; |
271 | 271 | default: $this->_error('Unsupported output format'); return false; |
272 | 272 | } |
@@ -283,8 +283,7 @@ discard block |
||
283 | 283 | // Forcing conversion of input to UCS4 array |
284 | 284 | // If one time encoding is given, use this, else the objects property |
285 | 285 | switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) { |
286 | - case 'utf8': |
|
287 | - $decoded = $this->_utf8_to_ucs4($decoded); |
|
286 | + case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded); |
|
288 | 287 | break; |
289 | 288 | case 'ucs4_string': |
290 | 289 | $decoded = $this->_ucs4_string_to_ucs4($decoded); |
@@ -380,12 +379,12 @@ discard block |
||
380 | 379 | } |
381 | 380 | } |
382 | 381 | $parsed['host'] = join('.', $arr); |
383 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
384 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
385 | - $parsed['host']. |
|
386 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
387 | - (empty($parsed['path']) ? '' : $parsed['path']). |
|
388 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
382 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')) . |
|
383 | + (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@') . |
|
384 | + $parsed['host'] . |
|
385 | + (empty($parsed['port']) ? '' : ':' . $parsed['port']) . |
|
386 | + (empty($parsed['path']) ? '' : $parsed['path']) . |
|
387 | + (empty($parsed['query']) ? '' : '?' . $parsed['query']) . |
|
389 | 388 | (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
390 | 389 | return $return; |
391 | 390 | } |
@@ -439,16 +438,15 @@ discard block |
||
439 | 438 | for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) { |
440 | 439 | $digit = $this->_decode_digit($encoded{$enco_idx++}); |
441 | 440 | $idx += $digit * $w; |
442 | - $t = ($k <= $bias) ? $this->_tmin : |
|
443 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
441 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
444 | 442 | if ($digit < $t) { |
445 | 443 | break; |
446 | 444 | } |
447 | - $w = (int) ($w * ($this->_base - $t)); |
|
445 | + $w = (int)($w * ($this->_base - $t)); |
|
448 | 446 | } |
449 | 447 | $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first); |
450 | 448 | $is_first = false; |
451 | - $char += (int) ($idx / ($deco_len + 1)); |
|
449 | + $char += (int)($idx / ($deco_len + 1)); |
|
452 | 450 | $idx %= ($deco_len + 1); |
453 | 451 | if ($deco_len > 0) { |
454 | 452 | // Make room for the decoded char |
@@ -540,13 +538,12 @@ discard block |
||
540 | 538 | $delta++; |
541 | 539 | } elseif ($decoded[$i] == $cur_code) { |
542 | 540 | for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) { |
543 | - $t = ($k <= $bias) ? $this->_tmin : |
|
544 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
541 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
545 | 542 | if ($q < $t) { |
546 | 543 | break; |
547 | 544 | } |
548 | 545 | $encoded .= $this->_encode_digit(intval($t + (($q - $t) % ($this->_base - $t)))); //v0.4.5 Changed from ceil() to intval() |
549 | - $q = (int) (($q - $t) / ($this->_base - $t)); |
|
546 | + $q = (int)(($q - $t) / ($this->_base - $t)); |
|
550 | 547 | } |
551 | 548 | $encoded .= $this->_encode_digit($q); |
552 | 549 | $bias = $this->_adapt($delta, $codecount + 1, $is_first); |
@@ -641,18 +638,18 @@ discard block |
||
641 | 638 | if (0xAC00 <= $v && $v <= 0xD7AF) { |
642 | 639 | // Hangul syllable decomposition |
643 | 640 | foreach ($this->_hangul_decompose($v) as $out) { |
644 | - $output[] = (int) $out; |
|
641 | + $output[] = (int)$out; |
|
645 | 642 | } |
646 | 643 | } elseif (($this->_idn_version == '2003') && isset(self::$NP['replacemaps_2003'][$v])) { |
647 | 644 | foreach ($this->_apply_cannonical_ordering(self::$NP['replacemaps_2003'][$v]) as $out) { |
648 | - $output[] = (int) $out; |
|
645 | + $output[] = (int)$out; |
|
649 | 646 | } |
650 | 647 | } elseif (($this->_idn_version == '2008') && isset(self::$NP['replacemaps'][$v])) { |
651 | 648 | foreach ($this->_apply_cannonical_ordering(self::$NP['replacemaps'][$v]) as $out) { |
652 | - $output[] = (int) $out; |
|
649 | + $output[] = (int)$out; |
|
653 | 650 | } |
654 | 651 | } else { |
655 | - $output[] = (int) $v; |
|
652 | + $output[] = (int)$v; |
|
656 | 653 | } |
657 | 654 | } |
658 | 655 | // Before applying any Combining, try to rearrange any Hangul syllables |
@@ -703,13 +700,13 @@ discard block |
||
703 | 700 | */ |
704 | 701 | protected function _hangul_decompose($char) |
705 | 702 | { |
706 | - $sindex = (int) $char - $this->_sbase; |
|
703 | + $sindex = (int)$char - $this->_sbase; |
|
707 | 704 | if ($sindex < 0 || $sindex >= $this->_scount) { |
708 | 705 | return array($char); |
709 | 706 | } |
710 | 707 | $result = array(); |
711 | - $result[] = (int) $this->_lbase + $sindex / $this->_ncount; |
|
712 | - $result[] = (int) $this->_vbase + ($sindex % $this->_ncount) / $this->_tcount; |
|
708 | + $result[] = (int)$this->_lbase + $sindex / $this->_ncount; |
|
709 | + $result[] = (int)$this->_vbase + ($sindex % $this->_ncount) / $this->_tcount; |
|
713 | 710 | $T = intval($this->_tbase + $sindex % $this->_tcount); |
714 | 711 | if ($T != $this->_tbase) { |
715 | 712 | $result[] = $T; |
@@ -730,11 +727,11 @@ discard block |
||
730 | 727 | return array(); |
731 | 728 | } |
732 | 729 | $result = array(); |
733 | - $last = (int) $input[0]; |
|
730 | + $last = (int)$input[0]; |
|
734 | 731 | $result[] = $last; // copy first char from input to output |
735 | 732 | |
736 | 733 | for ($i = 1; $i < $inp_len; ++$i) { |
737 | - $char = (int) $input[$i]; |
|
734 | + $char = (int)$input[$i]; |
|
738 | 735 | $sindex = $last - $this->_sbase; |
739 | 736 | $lindex = $last - $this->_lbase; |
740 | 737 | $vindex = $char - $this->_vbase; |
@@ -749,7 +746,7 @@ discard block |
||
749 | 746 | // Find out, whether two current characters form L and V |
750 | 747 | if (0 <= $lindex && $lindex < $this->_lcount && 0 <= $vindex && $vindex < $this->_vcount) { |
751 | 748 | // create syllable of form LV |
752 | - $last = (int) $this->_sbase + ($lindex * $this->_vcount + $vindex) * $this->_tcount; |
|
749 | + $last = (int)$this->_sbase + ($lindex * $this->_vcount + $vindex) * $this->_tcount; |
|
753 | 750 | $result[(count($result) - 1)] = $last; // reset last |
754 | 751 | continue; // discard char |
755 | 752 | } |
@@ -898,7 +895,7 @@ discard block |
||
898 | 895 | return false; |
899 | 896 | } |
900 | 897 | if ('add' == $mode) { |
901 | - $output[$out_len] = (int) $v; |
|
898 | + $output[$out_len] = (int)$v; |
|
902 | 899 | ++$out_len; |
903 | 900 | continue; |
904 | 901 | } |
@@ -995,7 +992,7 @@ discard block |
||
995 | 992 | $out_len++; |
996 | 993 | $output[$out_len] = 0; |
997 | 994 | } |
998 | - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); |
|
995 | + $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4))); |
|
999 | 996 | } |
1000 | 997 | return $output; |
1001 | 998 | } |
@@ -1012,7 +1009,7 @@ discard block |
||
1012 | 1009 | if (self::$_mb_string_overload) { |
1013 | 1010 | return mb_strlen($string, '8bit'); |
1014 | 1011 | } |
1015 | - return strlen((binary) $string); |
|
1012 | + return strlen((binary)$string); |
|
1016 | 1013 | } |
1017 | 1014 | |
1018 | 1015 | /** |
@@ -30,15 +30,21 @@ discard block |
||
30 | 30 | } |
31 | 31 | if (function_exists('mb_convert_encoding')) { |
32 | 32 | $conv = @mb_convert_encoding($string, 'UTF-8', strtoupper($encoding)); |
33 | - if ($conv) return $conv; |
|
33 | + if ($conv) { |
|
34 | + return $conv; |
|
35 | + } |
|
34 | 36 | } |
35 | 37 | if (function_exists('iconv')) { |
36 | 38 | $conv = @iconv(strtoupper($encoding), 'UTF-8', $string); |
37 | - if ($conv) return $conv; |
|
39 | + if ($conv) { |
|
40 | + return $conv; |
|
41 | + } |
|
38 | 42 | } |
39 | 43 | if (function_exists('libiconv')) { |
40 | 44 | $conv = @libiconv(strtoupper($encoding), 'UTF-8', $string); |
41 | - if ($conv) return $conv; |
|
45 | + if ($conv) { |
|
46 | + return $conv; |
|
47 | + } |
|
42 | 48 | } |
43 | 49 | return $safe; |
44 | 50 | } |
@@ -55,7 +61,9 @@ discard block |
||
55 | 61 | function decode_utf8($string = '', $encoding = 'iso-8859-1', $safe_mode = false) |
56 | 62 | { |
57 | 63 | $safe = ($safe_mode) ? $string : false; |
58 | - if (!$encoding) $encoding = 'ISO-8859-1'; |
|
64 | + if (!$encoding) { |
|
65 | + $encoding = 'ISO-8859-1'; |
|
66 | + } |
|
59 | 67 | if (strtoupper($encoding) == 'UTF-8' || strtoupper($encoding) == 'UTF8') { |
60 | 68 | return $string; |
61 | 69 | } elseif (strtoupper($encoding) == 'ISO-8859-1') { |
@@ -67,15 +75,21 @@ discard block |
||
67 | 75 | } |
68 | 76 | if (function_exists('mb_convert_encoding')) { |
69 | 77 | $conv = @mb_convert_encoding($string, strtoupper($encoding), 'UTF-8'); |
70 | - if ($conv) return $conv; |
|
78 | + if ($conv) { |
|
79 | + return $conv; |
|
80 | + } |
|
71 | 81 | } |
72 | 82 | if (function_exists('iconv')) { |
73 | 83 | $conv = @iconv('UTF-8', strtoupper($encoding), $string); |
74 | - if ($conv) return $conv; |
|
84 | + if ($conv) { |
|
85 | + return $conv; |
|
86 | + } |
|
75 | 87 | } |
76 | 88 | if (function_exists('libiconv')) { |
77 | 89 | $conv = @libiconv('UTF-8', strtoupper($encoding), $string); |
78 | - if ($conv) return $conv; |
|
90 | + if ($conv) { |
|
91 | + return $conv; |
|
92 | + } |
|
79 | 93 | } |
80 | 94 | return $safe; |
81 | 95 | } |
@@ -89,7 +103,9 @@ discard block |
||
89 | 103 | */ |
90 | 104 | function map_w1252_iso8859_1($string = '') |
91 | 105 | { |
92 | - if ($string == '') return ''; |
|
106 | + if ($string == '') { |
|
107 | + return ''; |
|
108 | + } |
|
93 | 109 | $return = ''; |
94 | 110 | for ($i = 0; $i < strlen($string); ++$i) { |
95 | 111 | $c = ord($string{$i}); |
@@ -116,7 +132,9 @@ discard block |
||
116 | 132 | */ |
117 | 133 | function map_iso8859_1_w1252($string = '') |
118 | 134 | { |
119 | - if ($string == '') return ''; |
|
135 | + if ($string == '') { |
|
136 | + return ''; |
|
137 | + } |
|
120 | 138 | $return = ''; |
121 | 139 | for ($i = 0; $i < strlen($string); ++$i) { |
122 | 140 | $c = ord($string{$i}); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | if (isset($_REQUEST['lang'])) { |
25 | 25 | if ('de' == $_REQUEST['lang'] || 'en' == $_REQUEST['lang']) { |
26 | 26 | $lang = $_REQUEST['lang']; |
27 | - $add .= '<input type="hidden" name="lang" value="'.$lang.'" />'."\n"; |
|
27 | + $add .= '<input type="hidden" name="lang" value="' . $lang . '" />' . "\n"; |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | ?> |