@@ -260,6 +260,9 @@ |
||
| 260 | 260 | |
| 261 | 261 | |
| 262 | 262 | |
| 263 | + /** |
|
| 264 | + * @param string $char |
|
| 265 | + */ |
|
| 263 | 266 | public static function IntString2Bool($char) { |
| 264 | 267 | |
| 265 | 268 | return $char == '1' ? true : ($char == '0' ? false : null); |
@@ -295,6 +295,9 @@ discard block |
||
| 295 | 295 | )); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | + /** |
|
| 299 | + * @param string $file |
|
| 300 | + */ |
|
| 298 | 301 | protected function unlink($file){ |
| 299 | 302 | $file = realpath($file); |
| 300 | 303 | if ($this->basedir==$file || strlen($this->basedir)>=strlen($file)) |
@@ -312,6 +315,9 @@ discard block |
||
| 312 | 315 | } |
| 313 | 316 | } |
| 314 | 317 | |
| 318 | + /** |
|
| 319 | + * @param string $dir |
|
| 320 | + */ |
|
| 315 | 321 | protected function getName($file, $dir){ |
| 316 | 322 | $files = array(); |
| 317 | 323 | foreach ((array)glob($dir . '/*') as $f) |
@@ -340,11 +346,17 @@ discard block |
||
| 340 | 346 | return $this->checkFile($dir) ? $dir : $this->basedir; |
| 341 | 347 | } |
| 342 | 348 | |
| 349 | + /** |
|
| 350 | + * @param string $file |
|
| 351 | + */ |
|
| 343 | 352 | protected function getPath($file){ |
| 344 | 353 | $file = $this->normalize(substr($file, $this->length)); |
| 345 | 354 | return substr($file, FileManagerUtility::startsWith($file, '/') ? 1 : 0); |
| 346 | 355 | } |
| 347 | 356 | |
| 357 | + /** |
|
| 358 | + * @param string $file |
|
| 359 | + */ |
|
| 348 | 360 | protected function checkFile($file){ |
| 349 | 361 | $mimes = $this->getAllowedMimeTypes(); |
| 350 | 362 | $hasFilter = $this->options['filter'] && count($mimes); |
@@ -379,6 +391,9 @@ discard block |
||
| 379 | 391 | /* Stripped-down version of some Styx PHP Framework-Functionality bundled with this FileBrowser. Styx is located at: http://styx.og5.net */ |
| 380 | 392 | class FileManagerUtility { |
| 381 | 393 | |
| 394 | + /** |
|
| 395 | + * @param string $look |
|
| 396 | + */ |
|
| 382 | 397 | public static function endsWith($string, $look){ |
| 383 | 398 | return strrpos($string, $look)===strlen($string)-strlen($look); |
| 384 | 399 | } |
@@ -403,6 +418,9 @@ discard block |
||
| 403 | 418 | return !empty($options) ? self::checkTitle($data, $options) : $data; |
| 404 | 419 | } |
| 405 | 420 | |
| 421 | + /** |
|
| 422 | + * @param string $data |
|
| 423 | + */ |
|
| 406 | 424 | protected static function checkTitle($data, $options = array(), $i = 0){ |
| 407 | 425 | if (!is_array($options)) return $data; |
| 408 | 426 | |
@@ -413,6 +431,9 @@ discard block |
||
| 413 | 431 | return $data.($i ? '_' . $i : ''); |
| 414 | 432 | } |
| 415 | 433 | |
| 434 | + /** |
|
| 435 | + * @param string $str |
|
| 436 | + */ |
|
| 416 | 437 | public static function isBinary($str){ |
| 417 | 438 | $array = array(0, 255); |
| 418 | 439 | for($i = 0; $i < strlen($str); $i++) |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @param string $file |
| 19 | 19 | * @param string $to |
| 20 | 20 | * @param array $options |
| 21 | - * @return bool|string Path to moved file or false if the specified upload does not exist |
|
| 21 | + * @return false|string Path to moved file or false if the specified upload does not exist |
|
| 22 | 22 | */ |
| 23 | 23 | public static function move($file, $to, $options = null){ |
| 24 | 24 | if(!self::exists($file)) return false; |
@@ -462,7 +462,6 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | /** |
| 464 | 464 | * HTTP level error handling. |
| 465 | - * @param integer $code The HTTP error code to return to the client. This defaults to 400. |
|
| 466 | 465 | * @param string $message Error message to send to the client. This defaults to the standard HTTP error messages. |
| 467 | 466 | */ |
| 468 | 467 | function http_error_exit($error = 'HTTP_CLIENT_BAD_REQUEST', $message='') { |
@@ -483,6 +482,7 @@ discard block |
||
| 483 | 482 | |
| 484 | 483 | /** |
| 485 | 484 | * Check to see if the supplied filename is inside |
| 485 | + * @param string $checkfile |
|
| 486 | 486 | */ |
| 487 | 487 | function directory_contains($container_directory, $checkfile) { |
| 488 | 488 | |
@@ -778,6 +778,9 @@ discard block |
||
| 778 | 778 | * **************************************************************************}} |
| 779 | 779 | */ |
| 780 | 780 | |
| 781 | +/** |
|
| 782 | + * @param string $chroot |
|
| 783 | + */ |
|
| 781 | 784 | function store_uploaded_file($filename, $filedata, $chroot) { |
| 782 | 785 | |
| 783 | 786 | // If chroot is empty, then we will not perform the operation. |
@@ -88,7 +88,6 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get initial content |
| 90 | 90 | * |
| 91 | - * @param bool $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat |
|
| 92 | 91 | * @return string |
| 93 | 92 | */ |
| 94 | 93 | function getValue() { |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | /** |
| 116 | 115 | * prepare HTML for output |
| 117 | 116 | * |
| 118 | - * @return sting HTML |
|
| 117 | + * @return string HTML |
|
| 119 | 118 | */ |
| 120 | 119 | function render() |
| 121 | 120 | { |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | /** |
| 129 | 129 | * prepare HTML for output |
| 130 | 130 | * |
| 131 | - * @return sting HTML |
|
| 131 | + * @return string HTML |
|
| 132 | 132 | */ |
| 133 | 133 | function render() |
| 134 | 134 | { |
@@ -88,7 +88,6 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get initial content |
| 90 | 90 | * |
| 91 | - * @param bool $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat |
|
| 92 | 91 | * @return string |
| 93 | 92 | */ |
| 94 | 93 | function getValue() { |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | /** |
| 116 | 115 | * prepare HTML for output |
| 117 | 116 | * |
| 118 | - * @return sting HTML |
|
| 117 | + * @return string HTML |
|
| 119 | 118 | */ |
| 120 | 119 | function render() |
| 121 | 120 | { |
@@ -88,7 +88,6 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get initial content |
| 90 | 90 | * |
| 91 | - * @param bool $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat |
|
| 92 | 91 | * @return string |
| 93 | 92 | */ |
| 94 | 93 | function getValue() { |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | /** |
| 116 | 115 | * prepare HTML for output |
| 117 | 116 | * |
| 118 | - * @return sting HTML |
|
| 117 | + * @return string HTML |
|
| 119 | 118 | */ |
| 120 | 119 | function render() |
| 121 | 120 | { |
@@ -88,7 +88,6 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get initial content |
| 90 | 90 | * |
| 91 | - * @param bool $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat |
|
| 92 | 91 | * @return string |
| 93 | 92 | */ |
| 94 | 93 | function getValue() { |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | /** |
| 116 | 115 | * prepare HTML for output |
| 117 | 116 | * |
| 118 | - * @return sting HTML |
|
| 117 | + * @return string HTML |
|
| 119 | 118 | */ |
| 120 | 119 | function render() |
| 121 | 120 | { |