@@ -109,7 +109,8 @@ |
||
109 | 109 | $this->getUserId(), |
110 | 110 | $this->getId(), |
111 | 111 | $name |
112 | - )) {// $this->getId() is 0 when creating a new list -> condition has no effect |
|
112 | + )) { |
|
113 | +// $this->getId() is 0 when creating a new list -> condition has no effect |
|
113 | 114 | return ERROR_DUPLICATE_LISTNAME; |
114 | 115 | } elseif ($visibility >= 2 && strlen($name) < 10) { |
115 | 116 | return ERROR_BAD_LISTNAME; |
@@ -27,7 +27,8 @@ |
||
27 | 27 | $for_cachedesc, |
28 | 28 | $html, |
29 | 29 | $twolines = false |
30 | -) { |
|
30 | +) |
|
31 | +{ |
|
31 | 32 | global $opt, $translate; |
32 | 33 | |
33 | 34 | $ltext = ""; |
@@ -75,7 +75,8 @@ |
||
75 | 75 | |
76 | 76 | // $pw may not contain one of $addwords[] |
77 | 77 | foreach ($wordlist as $v) { |
78 | - if (mb_stripos($pw_lc, $v) !== false) {// mb_stripos needs PHP 5.2 |
|
78 | + if (mb_stripos($pw_lc, $v) !== false) { |
|
79 | +// mb_stripos needs PHP 5.2 |
|
79 | 80 | return false; |
80 | 81 | } |
81 | 82 | } |
@@ -104,7 +104,8 @@ |
||
104 | 104 | $allowed_logtypes[] = 14; |
105 | 105 | } // locked, invisible |
106 | 106 | } |
107 | - if ($cache_type == 6) { // event |
|
107 | + if ($cache_type == 6) { |
|
108 | +// event |
|
108 | 109 | $allowed_logtypes[] = 8; // will attend |
109 | 110 | $allowed_logtypes[] = 7; // attended |
110 | 111 | } else { |
@@ -2340,7 +2340,9 @@ discard block |
||
2340 | 2340 | } |
2341 | 2341 | |
2342 | 2342 | // No input, no output, what else did you expect? |
2343 | - if (empty($decoded)) return ''; |
|
2343 | + if (empty($decoded)) { |
|
2344 | + return ''; |
|
2345 | + } |
|
2344 | 2346 | |
2345 | 2347 | // Anchors for iteration |
2346 | 2348 | $last_begin = 0; |
@@ -2429,7 +2431,8 @@ discard block |
||
2429 | 2431 | |
2430 | 2432 | // Negotiate input and try to determine, wether it is a plain string, |
2431 | 2433 | // an email address or something like a complete URL |
2432 | - if (strpos($input, '@')) { // Maybe it is an email address |
|
2434 | + if (strpos($input, '@')) { |
|
2435 | +// Maybe it is an email address |
|
2433 | 2436 | // No no in strict mode |
2434 | 2437 | if ($this->_strict_mode) { |
2435 | 2438 | throw new InvalidArgumentException('Only simple domain name parts can be handled in strict mode'); |
@@ -2438,10 +2441,13 @@ discard block |
||
2438 | 2441 | $arr = explode('.', $input); |
2439 | 2442 | foreach ($arr as $k => $v) { |
2440 | 2443 | $conv = $this->_decode($v); |
2441 | - if ($conv) $arr[$k] = $conv; |
|
2444 | + if ($conv) { |
|
2445 | + $arr[$k] = $conv; |
|
2446 | + } |
|
2442 | 2447 | } |
2443 | 2448 | $return = $email_pref . '@' . join('.', $arr); |
2444 | - } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters) |
|
2449 | + } elseif (preg_match('![:\./]!', $input)) { |
|
2450 | +// Or a complete domain name (with or without paths / parameters) |
|
2445 | 2451 | // No no in strict mode |
2446 | 2452 | if ($this->_strict_mode) { |
2447 | 2453 | throw new InvalidArgumentException('Only simple domain name parts can be handled in strict mode'); |
@@ -2452,22 +2458,28 @@ discard block |
||
2452 | 2458 | $arr = explode('.', $parsed['host']); |
2453 | 2459 | foreach ($arr as $k => $v) { |
2454 | 2460 | $conv = $this->_decode($v); |
2455 | - if ($conv) $arr[$k] = $conv; |
|
2461 | + if ($conv) { |
|
2462 | + $arr[$k] = $conv; |
|
2463 | + } |
|
2456 | 2464 | } |
2457 | 2465 | $parsed['host'] = join('.', $arr); |
2458 | 2466 | if (isset($parsed['scheme'])) { |
2459 | 2467 | $parsed['scheme'] .= (strtolower($parsed['scheme']) == 'mailto') ? ':' : '://'; |
2460 | 2468 | } |
2461 | 2469 | $return = $this->_unparse_url($parsed); |
2462 | - } else { // parse_url seems to have failed, try without it |
|
2470 | + } else { |
|
2471 | +// parse_url seems to have failed, try without it |
|
2463 | 2472 | $arr = explode('.', $input); |
2464 | 2473 | foreach ($arr as $k => $v) { |
2465 | 2474 | $conv = $this->_decode($v); |
2466 | - if ($conv) $arr[$k] = $conv; |
|
2475 | + if ($conv) { |
|
2476 | + $arr[$k] = $conv; |
|
2477 | + } |
|
2467 | 2478 | } |
2468 | 2479 | $return = join('.', $arr); |
2469 | 2480 | } |
2470 | - } else { // Otherwise we consider it being a pure domain name string |
|
2481 | + } else { |
|
2482 | +// Otherwise we consider it being a pure domain name string |
|
2471 | 2483 | $return = $this->_decode($input); |
2472 | 2484 | } |
2473 | 2485 | // The output is UTF-8 by default, other output formats need conversion here |
@@ -3115,7 +3127,8 @@ discard block |
||
3115 | 3127 | for ($k = 0; $k < $inp_len; ++$k) { |
3116 | 3128 | $v = ord($input{$k}); // Extract byte from input string |
3117 | 3129 | |
3118 | - if ($v < 128) { // We found an ASCII char - put into stirng as is |
|
3130 | + if ($v < 128) { |
|
3131 | +// We found an ASCII char - put into stirng as is |
|
3119 | 3132 | $output[$out_len] = $v; |
3120 | 3133 | ++$out_len; |
3121 | 3134 | if ('add' == $mode) { |
@@ -3123,23 +3136,29 @@ discard block |
||
3123 | 3136 | } |
3124 | 3137 | continue; |
3125 | 3138 | } |
3126 | - if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char |
|
3139 | + if ('next' == $mode) { |
|
3140 | +// Try to find the next start byte; determine the width of the Unicode char |
|
3127 | 3141 | $start_byte = $v; |
3128 | 3142 | $mode = 'add'; |
3129 | 3143 | $test = 'range'; |
3130 | - if ($v >> 5 == 6) { // &110xxxxx 10xxxxx |
|
3144 | + if ($v >> 5 == 6) { |
|
3145 | +// &110xxxxx 10xxxxx |
|
3131 | 3146 | $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left |
3132 | 3147 | $v = ($v - 192) << 6; |
3133 | - } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx |
|
3148 | + } elseif ($v >> 4 == 14) { |
|
3149 | +// &1110xxxx 10xxxxxx 10xxxxxx |
|
3134 | 3150 | $next_byte = 1; |
3135 | 3151 | $v = ($v - 224) << 12; |
3136 | - } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx |
|
3152 | + } elseif ($v >> 3 == 30) { |
|
3153 | +// &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx |
|
3137 | 3154 | $next_byte = 2; |
3138 | 3155 | $v = ($v - 240) << 18; |
3139 | - } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx |
|
3156 | + } elseif ($v >> 2 == 62) { |
|
3157 | +// &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx |
|
3140 | 3158 | $next_byte = 3; |
3141 | 3159 | $v = ($v - 248) << 24; |
3142 | - } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx |
|
3160 | + } elseif ($v >> 1 == 126) { |
|
3161 | +// &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx |
|
3143 | 3162 | $next_byte = 4; |
3144 | 3163 | $v = ($v - 252) << 30; |
3145 | 3164 | } else { |
@@ -3158,7 +3177,8 @@ discard block |
||
3158 | 3177 | throw new OutOfRangeException('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
3159 | 3178 | } |
3160 | 3179 | } |
3161 | - if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx |
|
3180 | + if ($v >> 6 == 2) { |
|
3181 | +// Bit mask must be 10xxxxxx |
|
3162 | 3182 | $v = ($v - 128) << ($next_byte * 6); |
3163 | 3183 | $output[($out_len - 1)] += $v; |
3164 | 3184 | --$next_byte; |
@@ -51,7 +51,8 @@ discard block |
||
51 | 51 | $desc = isset($_POST['desc']) ? $_POST['desc'] : ''; // Ocprop |
52 | 52 | |
53 | 53 | // read descMode; if not set, initialize from user profile |
54 | - if (isset($_POST['descMode'])) { // Ocprop |
|
54 | + if (isset($_POST['descMode'])) { |
|
55 | +// Ocprop |
|
55 | 56 | $descMode = $_POST['descMode'] + 0; |
56 | 57 | if (($descMode < 1) || ($descMode > 3)) { |
57 | 58 | $descMode = 3; |
@@ -89,7 +90,8 @@ discard block |
||
89 | 90 | $desc_lang_exists = false; |
90 | 91 | |
91 | 92 | //save to db? |
92 | - if (isset($_POST['submitform']) && $sel_lang != '0') { // Ocprop |
|
93 | + if (isset($_POST['submitform']) && $sel_lang != '0') { |
|
94 | +// Ocprop |
|
93 | 95 | //check if the entered language already exists |
94 | 96 | $desc_rs = sql( |
95 | 97 | "SELECT `id` |
@@ -61,7 +61,8 @@ |
||
61 | 61 | } else { |
62 | 62 | showAdoptScreen($cacheid, $submit); |
63 | 63 | } |
64 | -} else { // if ($action == 'listbyuser') |
|
64 | +} else { |
|
65 | +// if ($action == 'listbyuser') |
|
65 | 66 | $tpl->assign('action', 'listbyuser'); |
66 | 67 | listRequestsByUserId(); |
67 | 68 | } |
@@ -117,7 +117,8 @@ |
||
117 | 117 | ++ $this->lines_modified; |
118 | 118 | } |
119 | 119 | } |
120 | - if (preg_match('/\<\?\s/', $line)) { # relies on \n at EOL |
|
120 | + if (preg_match('/\<\?\s/', $line)) { |
|
121 | +# relies on \n at EOL |
|
121 | 122 | self::warn('short open tag in line ' . $n . ' of ' . $display_filepath); |
122 | 123 | } |
123 | 124 | ++ $n; |
@@ -27,7 +27,8 @@ |
||
27 | 27 | $for_cachedesc, |
28 | 28 | $html, |
29 | 29 | $twolines = false |
30 | -) { |
|
30 | +) |
|
31 | +{ |
|
31 | 32 | global $opt, $translate; |
32 | 33 | |
33 | 34 | $ltext = ""; |