@@ -13,6 +13,9 @@ discard block |
||
13 | 13 | //// |
14 | 14 | // This function validates a plain text password with a |
15 | 15 | // salted or phpass password |
16 | + /** |
|
17 | + * @param string $plain |
|
18 | + */ |
|
16 | 19 | function tep_validate_password($plain, $encrypted) { |
17 | 20 | if (tep_not_null($plain) && tep_not_null($encrypted)) { |
18 | 21 | if (tep_password_type($encrypted) == 'salt') { |
@@ -52,6 +55,9 @@ discard block |
||
52 | 55 | //// |
53 | 56 | // This function encrypts a phpass password from a plaintext |
54 | 57 | // password. |
58 | + /** |
|
59 | + * @param string $plain |
|
60 | + */ |
|
55 | 61 | function tep_encrypt_password($plain) { |
56 | 62 | if (!class_exists('PasswordHash')) { |
57 | 63 | include(DIR_WS_CLASSES . 'passwordhash.php'); |
@@ -14,6 +14,9 @@ |
||
14 | 14 | |
15 | 15 | //// |
16 | 16 | // Sets the status of a special product |
17 | + /** |
|
18 | + * @param integer $status |
|
19 | + */ |
|
17 | 20 | function tep_set_specials_status($specials_id, $status) { |
18 | 21 | $OSCOM_Db = Registry::get('Db'); |
19 | 22 |
@@ -53,6 +53,11 @@ discard block |
||
53 | 53 | // ------------------------------------------------------------------- |
54 | 54 | // Parse RSS file and returns associative array. |
55 | 55 | // ------------------------------------------------------------------- |
56 | + |
|
57 | + /** |
|
58 | + * @param string $rss_url |
|
59 | + * @param string $key |
|
60 | + */ |
|
56 | 61 | function Get ($rss_url, $key = null) { |
57 | 62 | // If CACHE ENABLED |
58 | 63 | if ($this->cache_dir != '') { |
@@ -114,6 +119,10 @@ discard block |
||
114 | 119 | // ------------------------------------------------------------------- |
115 | 120 | // Replace HTML entities &something; by real characters |
116 | 121 | // ------------------------------------------------------------------- |
122 | + |
|
123 | + /** |
|
124 | + * @param string $string |
|
125 | + */ |
|
117 | 126 | function unhtmlentities ($string) { |
118 | 127 | // Get HTML entities table |
119 | 128 | $trans_tbl = get_html_translation_table (HTML_ENTITIES, ENT_QUOTES); |
@@ -124,6 +124,9 @@ discard block |
||
124 | 124 | |
125 | 125 | } |
126 | 126 | |
127 | + /** |
|
128 | + * @param string $raw_datetime |
|
129 | + */ |
|
127 | 130 | function tep_datetime_short($raw_datetime) { |
128 | 131 | if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false; |
129 | 132 | |
@@ -261,6 +264,9 @@ discard block |
||
261 | 264 | return $image; |
262 | 265 | } |
263 | 266 | |
267 | + /** |
|
268 | + * @param integer $len |
|
269 | + */ |
|
264 | 270 | function tep_break_string($string, $len, $break_char = '-') { |
265 | 271 | $l = 0; |
266 | 272 | $output = ''; |
@@ -317,6 +323,9 @@ discard block |
||
317 | 323 | } |
318 | 324 | } |
319 | 325 | |
326 | + /** |
|
327 | + * @param string $component |
|
328 | + */ |
|
320 | 329 | function tep_browser_detect($component) { |
321 | 330 | global $HTTP_USER_AGENT; |
322 | 331 | |
@@ -379,6 +388,11 @@ discard block |
||
379 | 388 | return $geo_zone_id; |
380 | 389 | } |
381 | 390 | |
391 | + /** |
|
392 | + * @param boolean $html |
|
393 | + * @param string $boln |
|
394 | + * @param string $eoln |
|
395 | + */ |
|
382 | 396 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
383 | 397 | $Qaddress = Registry::get('Db')->get('address_format', 'address_format', ['address_format_id' => (int)$address_format_id]); |
384 | 398 | |
@@ -475,6 +489,9 @@ discard block |
||
475 | 489 | return $def_state; |
476 | 490 | } |
477 | 491 | |
492 | + /** |
|
493 | + * @param string $params |
|
494 | + */ |
|
478 | 495 | function tep_get_uprid($prid, $params) { |
479 | 496 | $uprid = $prid; |
480 | 497 | if ( (is_array($params)) && (!strstr($prid, '{')) ) { |
@@ -582,6 +599,9 @@ discard block |
||
582 | 599 | //// |
583 | 600 | // Wrapper for class_exists() function |
584 | 601 | // This function is not available in all PHP versions so we test it before using it. |
602 | + /** |
|
603 | + * @param string $class_name |
|
604 | + */ |
|
585 | 605 | function tep_class_exists($class_name) { |
586 | 606 | if (function_exists('class_exists')) { |
587 | 607 | return class_exists($class_name); |
@@ -787,6 +807,9 @@ discard block |
||
787 | 807 | |
788 | 808 | //// |
789 | 809 | // Sets the status of a banner |
810 | + /** |
|
811 | + * @param integer $status |
|
812 | + */ |
|
790 | 813 | function tep_set_banner_status($banners_id, $status) { |
791 | 814 | $OSCOM_Db = Registry::get('Db'); |
792 | 815 | |
@@ -861,6 +884,9 @@ discard block |
||
861 | 884 | |
862 | 885 | //// |
863 | 886 | // Sets the status of a product on special |
887 | + /** |
|
888 | + * @param integer $status |
|
889 | + */ |
|
864 | 890 | function tep_set_specials_status($specials_id, $status) { |
865 | 891 | $OSCOM_Db = Registry::get('Db'); |
866 | 892 | |
@@ -1276,6 +1302,11 @@ discard block |
||
1276 | 1302 | return $value; |
1277 | 1303 | } |
1278 | 1304 | |
1305 | + /** |
|
1306 | + * @param string $to_name |
|
1307 | + * @param string $email_subject |
|
1308 | + * @param string $email_text |
|
1309 | + */ |
|
1279 | 1310 | function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { |
1280 | 1311 | if (SEND_EMAILS != 'true') return false; |
1281 | 1312 | |
@@ -1327,6 +1358,9 @@ discard block |
||
1327 | 1358 | |
1328 | 1359 | //// |
1329 | 1360 | // Wrapper function for round() for php3 compatibility |
1361 | + /** |
|
1362 | + * @return double |
|
1363 | + */ |
|
1330 | 1364 | function tep_round($value, $precision) { |
1331 | 1365 | return round($value, $precision); |
1332 | 1366 | } |
@@ -1469,6 +1503,10 @@ discard block |
||
1469 | 1503 | |
1470 | 1504 | //// |
1471 | 1505 | // Return a random value |
1506 | + /** |
|
1507 | + * @param integer $min |
|
1508 | + * @param integer $max |
|
1509 | + */ |
|
1472 | 1510 | function tep_rand($min = null, $max = null) { |
1473 | 1511 | static $seeded; |
1474 | 1512 | |
@@ -1484,6 +1522,9 @@ discard block |
||
1484 | 1522 | } |
1485 | 1523 | |
1486 | 1524 | // nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n) |
1525 | + /** |
|
1526 | + * @param string[] $from |
|
1527 | + */ |
|
1487 | 1528 | function tep_convert_linefeeds($from, $to, $string) { |
1488 | 1529 | return str_replace($from, $to, $string); |
1489 | 1530 | } |
@@ -32,6 +32,9 @@ |
||
32 | 32 | return MODULE_SECURITY_CHECK_EXTENDED_EXT_DIRECTORY_LISTING_HTTP_200; |
33 | 33 | } |
34 | 34 | |
35 | + /** |
|
36 | + * @param string $url |
|
37 | + */ |
|
35 | 38 | function getHttpRequest($url) { |
36 | 39 | $server = parse_url($url); |
37 | 40 |
@@ -54,6 +54,9 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | + /** |
|
58 | + * @param integer $parent_id |
|
59 | + */ |
|
57 | 60 | protected function _buildBranch($parent_id, $level = 0) { |
58 | 61 | $result = ((($level === 0) && ($this->parent_group_apply_to_root === true)) || ($level > 0)) ? $this->parent_group_start_string : null; |
59 | 62 | |
@@ -278,6 +281,10 @@ discard block |
||
278 | 281 | $this->parent_end_string = $parent_end_string; |
279 | 282 | } |
280 | 283 | |
284 | + /** |
|
285 | + * @param string $parent_group_start_string |
|
286 | + * @param string $parent_group_end_string |
|
287 | + */ |
|
281 | 288 | function setParentGroupString($parent_group_start_string, $parent_group_end_string, $apply_to_root = false) { |
282 | 289 | $this->parent_group_start_string = $parent_group_start_string; |
283 | 290 | $this->parent_group_end_string = $parent_group_end_string; |
@@ -301,6 +308,9 @@ discard block |
||
301 | 308 | } |
302 | 309 | } |
303 | 310 | |
311 | + /** |
|
312 | + * @param string $spacer_string |
|
313 | + */ |
|
304 | 314 | function setSpacerString($spacer_string, $spacer_multiplier = 2) { |
305 | 315 | $this->spacer_string = $spacer_string; |
306 | 316 | $this->spacer_multiplier = $spacer_multiplier; |
@@ -84,6 +84,9 @@ discard block |
||
84 | 84 | return $output; |
85 | 85 | } |
86 | 86 | |
87 | + /** |
|
88 | + * @param integer $count |
|
89 | + */ |
|
87 | 90 | function encode64($input, $count) |
88 | 91 | { |
89 | 92 | $output = ''; |
@@ -107,6 +110,9 @@ discard block |
||
107 | 110 | return $output; |
108 | 111 | } |
109 | 112 | |
113 | + /** |
|
114 | + * @param string $input |
|
115 | + */ |
|
110 | 116 | function gensalt_private($input) |
111 | 117 | { |
112 | 118 | $output = '$P$'; |
@@ -155,6 +161,9 @@ discard block |
||
155 | 161 | return $output; |
156 | 162 | } |
157 | 163 | |
164 | + /** |
|
165 | + * @param string $input |
|
166 | + */ |
|
158 | 167 | function gensalt_extended($input) |
159 | 168 | { |
160 | 169 | $count_log2 = min($this->iteration_count_log2 + 8, 24); |
@@ -173,6 +182,9 @@ discard block |
||
173 | 182 | return $output; |
174 | 183 | } |
175 | 184 | |
185 | + /** |
|
186 | + * @param string $input |
|
187 | + */ |
|
176 | 188 | function gensalt_blowfish($input) |
177 | 189 | { |
178 | 190 | # This one needs to use a different order of characters and a |
@@ -78,6 +78,9 @@ discard block |
||
78 | 78 | |
79 | 79 | //// |
80 | 80 | // Break a word in a string if it is longer than a specified length ($len) |
81 | + /** |
|
82 | + * @param integer $len |
|
83 | + */ |
|
81 | 84 | function tep_break_string($string, $len, $break_char = '-') { |
82 | 85 | $l = 0; |
83 | 86 | $output = ''; |
@@ -201,6 +204,9 @@ discard block |
||
201 | 204 | |
202 | 205 | //// |
203 | 206 | // Returns the clients browser |
207 | + /** |
|
208 | + * @param string $component |
|
209 | + */ |
|
204 | 210 | function tep_browser_detect($component) { |
205 | 211 | return stristr($_SERVER['HTTP_USER_AGENT'], $component); |
206 | 212 | } |
@@ -251,6 +257,9 @@ discard block |
||
251 | 257 | |
252 | 258 | //// |
253 | 259 | // Wrapper function for round() |
260 | + /** |
|
261 | + * @return double |
|
262 | + */ |
|
254 | 263 | function tep_round($number, $precision) { |
255 | 264 | if (strpos($number, '.') && (strlen(substr($number, strpos($number, '.')+1)) > $precision)) { |
256 | 265 | $number = substr($number, 0, strpos($number, '.') + 1 + $precision + 1); |
@@ -430,6 +439,11 @@ discard block |
||
430 | 439 | //// |
431 | 440 | // Return a formatted address |
432 | 441 | // TABLES: address_format |
442 | + /** |
|
443 | + * @param boolean $html |
|
444 | + * @param string $boln |
|
445 | + * @param string $eoln |
|
446 | + */ |
|
433 | 447 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
434 | 448 | $OSCOM_Db = Registry::get('Db'); |
435 | 449 | |
@@ -958,6 +972,9 @@ discard block |
||
958 | 972 | |
959 | 973 | //// |
960 | 974 | // Return a product ID with attributes |
975 | + /** |
|
976 | + * @param string $params |
|
977 | + */ |
|
961 | 978 | function tep_get_uprid($prid, $params) { |
962 | 979 | if (is_numeric($prid)) { |
963 | 980 | $uprid = (int)$prid; |
@@ -1039,6 +1056,11 @@ discard block |
||
1039 | 1056 | // $from_email_adress The eMail address of the sender, |
1040 | 1057 | // e.g. [email protected] |
1041 | 1058 | |
1059 | + /** |
|
1060 | + * @param string $to_name |
|
1061 | + * @param string $email_subject |
|
1062 | + * @param string $email_text |
|
1063 | + */ |
|
1042 | 1064 | function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { |
1043 | 1065 | if (SEND_EMAILS != 'true') return false; |
1044 | 1066 | |
@@ -1098,6 +1120,9 @@ discard block |
||
1098 | 1120 | return tep_count_modules(MODULE_SHIPPING_INSTALLED); |
1099 | 1121 | } |
1100 | 1122 | |
1123 | + /** |
|
1124 | + * @param integer $length |
|
1125 | + */ |
|
1101 | 1126 | function tep_create_random_value($length, $type = 'mixed') { |
1102 | 1127 | if ( ($type != 'mixed') && ($type != 'chars') && ($type != 'digits')) $type = 'mixed'; |
1103 | 1128 | |
@@ -1253,6 +1278,10 @@ discard block |
||
1253 | 1278 | |
1254 | 1279 | //// |
1255 | 1280 | // Return a random value |
1281 | + /** |
|
1282 | + * @param integer $min |
|
1283 | + * @param integer $max |
|
1284 | + */ |
|
1256 | 1285 | function tep_rand($min = null, $max = null) { |
1257 | 1286 | |
1258 | 1287 | if (isset($min) && isset($max)) { |
@@ -1372,6 +1401,9 @@ discard block |
||
1372 | 1401 | } |
1373 | 1402 | |
1374 | 1403 | // Convert linefeeds |
1404 | + /** |
|
1405 | + * @param string[] $from |
|
1406 | + */ |
|
1375 | 1407 | function tep_convert_linefeeds($from, $to, $string) { |
1376 | 1408 | return str_replace($from, $to, $string); |
1377 | 1409 | } |
@@ -71,6 +71,9 @@ |
||
71 | 71 | return $result; |
72 | 72 | } |
73 | 73 | |
74 | + /** |
|
75 | + * @param string $pathname |
|
76 | + */ |
|
74 | 77 | public static function displayPath($pathname) |
75 | 78 | { |
76 | 79 | return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $pathname); |