@@ -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 = ""; |
@@ -509,10 +509,11 @@ discard block |
||
509 | 509 | |
510 | 510 | public function getStatNotFound() |
511 | 511 | { |
512 | - if ($this->reUserStat->exist()) |
|
513 | - return $this->reUserStat->getValue('notfound'); |
|
514 | - else |
|
515 | - return 0; |
|
512 | + if ($this->reUserStat->exist()) { |
|
513 | + return $this->reUserStat->getValue('notfound'); |
|
514 | + } else { |
|
515 | + return 0; |
|
516 | + } |
|
516 | 517 | } |
517 | 518 | |
518 | 519 | public function getStatNote() |
@@ -1219,7 +1220,8 @@ discard block |
||
1219 | 1220 | /* |
1220 | 1221 | * check log or cache |
1221 | 1222 | */ |
1222 | - if ($object_type == OBJECT_CACHE) {// get filenames of the pictures of $this' caches |
|
1223 | + if ($object_type == OBJECT_CACHE) { |
|
1224 | +// get filenames of the pictures of $this' caches |
|
1223 | 1225 | $rs = sql( |
1224 | 1226 | "SELECT `pictures`.`url` " . |
1225 | 1227 | "FROM `pictures`,`caches` " . |
@@ -1228,7 +1230,8 @@ discard block |
||
1228 | 1230 | OBJECT_CACHE, |
1229 | 1231 | $this->getUserId() |
1230 | 1232 | ); |
1231 | - } elseif ($object_type == OBJECT_CACHELOG) {// get filenames of the pictures of $this' logs |
|
1233 | + } elseif ($object_type == OBJECT_CACHELOG) { |
|
1234 | +// get filenames of the pictures of $this' logs |
|
1232 | 1235 | $rs = sql( |
1233 | 1236 | "SELECT `pictures`.`url` " . |
1234 | 1237 | "FROM `pictures`,`cache_logs` " . |
@@ -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; |
@@ -106,7 +106,8 @@ discard block |
||
106 | 106 | tpl_set_var('short_desc', htmlspecialchars($short_desc, ENT_COMPAT, 'UTF-8')); |
107 | 107 | |
108 | 108 | // descMode auslesen, falls nicht gesetzt aus dem Profil laden |
109 | - if (isset($_POST['descMode'])) {// Ocprop |
|
109 | + if (isset($_POST['descMode'])) { |
|
110 | +// Ocprop |
|
110 | 111 | $descMode = $_POST['descMode'] + 0; |
111 | 112 | if (($descMode < 1) || ($descMode > 3)) { |
112 | 113 | $descMode = 3; |
@@ -569,7 +570,8 @@ discard block |
||
569 | 570 | |
570 | 571 | tpl_set_var('firstcache_note', mb_ereg_replace('%1', $opt['page']['sitename'], $firstcache_note)); |
571 | 572 | |
572 | - if (isset($_POST['submitform'])) // Ocprop |
|
573 | + if (isset($_POST['submitform'])) { |
|
574 | + // Ocprop |
|
573 | 575 | { |
574 | 576 | //check the entered data |
575 | 577 | |
@@ -577,6 +579,7 @@ discard block |
||
577 | 579 | if ($lat_h != '' || $lat_min != '') { |
578 | 580 | if (!mb_ereg_match('^[0-9]{1,2}$', $lat_h)) { |
579 | 581 | tpl_set_var('lat_message', $error_lat_not_ok); |
582 | + } |
|
580 | 583 | $error = true; |
581 | 584 | $lat_h_not_ok = true; |
582 | 585 | } else { |
@@ -39,7 +39,8 @@ discard block |
||
39 | 39 | } elseif ($action == 'delete') { |
40 | 40 | $queryid = isset($_REQUEST['queryid']) ? $_REQUEST['queryid'] + 0 : 0; |
41 | 41 | deletequery($queryid); |
42 | -} else { // default: view |
|
42 | +} else { |
|
43 | +// default: view |
|
43 | 44 | viewqueries(); |
44 | 45 | } |
45 | 46 | |
@@ -106,9 +107,9 @@ discard block |
||
106 | 107 | } |
107 | 108 | } else { |
108 | 109 | // save as |
109 | - if (sql_value("SELECT COUNT(*) FROM `queries` WHERE `id`='&1' AND `user_id`='&2'", 0, $saveas_queryid, $login->userid) == 0) |
|
110 | - $tpl->assign('errorMustSelectQuery', true); |
|
111 | - else { |
|
110 | + if (sql_value("SELECT COUNT(*) FROM `queries` WHERE `id`='&1' AND `user_id`='&2'", 0, $saveas_queryid, $login->userid) == 0) { |
|
111 | + $tpl->assign('errorMustSelectQuery', true); |
|
112 | + } else { |
|
112 | 113 | sql("UPDATE `queries` SET `options`='&1' WHERE `id`='&2'", $options, $saveas_queryid); |
113 | 114 | $tpl->redirect('query.php?action=view'); |
114 | 115 | } |
@@ -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 | } |