XOOPS Cube Legacy base repository
Revision | 13a9f182d0ce340007936c94cdfa89cf5f9f4ec4 (tree) |
---|---|
Zeit | 2012-01-27 22:46:19 |
Autor | kilica <kilica@704c...> |
Commiter | kilica |
- Fix Bug #3470792 - download the template, the extra null at the end of defect
git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1133 704cf05f-ae62-4b0e-a484-234ee0250e75
@@ -78,15 +78,15 @@ XOOPS changes onokazu <webmaster@xoops.org> | ||
78 | 78 | |
79 | 79 | /** |
80 | 80 | * tar Class |
81 | - * | |
81 | + * | |
82 | 82 | * This class reads and writes Tape-Archive (TAR) Files and Gzip |
83 | 83 | * compressed TAR files, which are mainly used on UNIX systems. |
84 | 84 | * This class works on both windows AND unix systems, and does |
85 | 85 | * NOT rely on external applications!! Woohoo! |
86 | - * | |
86 | + * | |
87 | 87 | * @author Josh Barger <joshb@npt.com> |
88 | 88 | * @copyright Copyright (C) 2002 Josh Barger |
89 | - * | |
89 | + * | |
90 | 90 | * @package kernel |
91 | 91 | * @subpackage core |
92 | 92 | */ |
@@ -121,9 +121,9 @@ class tar | ||
121 | 121 | /** |
122 | 122 | * Computes the unsigned Checksum of a file's header |
123 | 123 | * to try to ensure valid file |
124 | - * | |
124 | + * | |
125 | 125 | * @param string $bytestring |
126 | - * | |
126 | + * | |
127 | 127 | * @access private |
128 | 128 | */ |
129 | 129 | function __computeUnsignedChecksum($bytestring) |
@@ -141,11 +141,11 @@ class tar | ||
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Converts a NULL padded string to a non-NULL padded string |
144 | - * | |
144 | + * | |
145 | 145 | * @param string $string |
146 | - * | |
147 | - * @return string | |
148 | - * | |
146 | + * | |
147 | + * @return string | |
148 | + * | |
149 | 149 | * @access private |
150 | 150 | **/ |
151 | 151 | function __parseNullPaddedString($string) |
@@ -156,9 +156,9 @@ class tar | ||
156 | 156 | |
157 | 157 | /** |
158 | 158 | * This function parses the current TAR file |
159 | - * | |
159 | + * | |
160 | 160 | * @return bool always TRUE |
161 | - * | |
161 | + * | |
162 | 162 | * @access private |
163 | 163 | **/ |
164 | 164 | function __parseTar() |
@@ -262,10 +262,10 @@ class tar | ||
262 | 262 | |
263 | 263 | /** |
264 | 264 | * Read a non gzipped tar file in for processing. |
265 | - * | |
265 | + * | |
266 | 266 | * @param string $filename full filename |
267 | 267 | * @return bool always TRUE |
268 | - * | |
268 | + * | |
269 | 269 | * @access private |
270 | 270 | **/ |
271 | 271 | function __readTar($filename='') |
@@ -296,9 +296,9 @@ class tar | ||
296 | 296 | |
297 | 297 | /** |
298 | 298 | * Generates a TAR file from the processed data |
299 | - * | |
299 | + * | |
300 | 300 | * @return bool always TRUE |
301 | - * | |
301 | + * | |
302 | 302 | * @access private |
303 | 303 | **/ |
304 | 304 | function __generateTAR() |
@@ -395,9 +395,9 @@ class tar | ||
395 | 395 | |
396 | 396 | /** |
397 | 397 | * Open a TAR file |
398 | - * | |
398 | + * | |
399 | 399 | * @param string $filename |
400 | - * @return bool | |
400 | + * @return bool | |
401 | 401 | **/ |
402 | 402 | function openTAR($filename) |
403 | 403 | { |
@@ -424,7 +424,7 @@ class tar | ||
424 | 424 | |
425 | 425 | /** |
426 | 426 | * Appends a tar file to the end of the currently opened tar file. |
427 | - * | |
427 | + * | |
428 | 428 | * @param string $filename |
429 | 429 | * @return bool |
430 | 430 | **/ |
@@ -441,7 +441,7 @@ class tar | ||
441 | 441 | |
442 | 442 | /** |
443 | 443 | * Retrieves information about a file in the current tar archive |
444 | - * | |
444 | + * | |
445 | 445 | * @param string $filename |
446 | 446 | * @return string FALSE on fail |
447 | 447 | **/ |
@@ -459,7 +459,7 @@ class tar | ||
459 | 459 | |
460 | 460 | /** |
461 | 461 | * Retrieves information about a directory in the current tar archive |
462 | - * | |
462 | + * | |
463 | 463 | * @param string $dirname |
464 | 464 | * @return string FALSE on fail |
465 | 465 | **/ |
@@ -477,7 +477,7 @@ class tar | ||
477 | 477 | |
478 | 478 | /** |
479 | 479 | * Check if this tar archive contains a specific file |
480 | - * | |
480 | + * | |
481 | 481 | * @param string $filename |
482 | 482 | * @return bool |
483 | 483 | **/ |
@@ -494,7 +494,7 @@ class tar | ||
494 | 494 | |
495 | 495 | /** |
496 | 496 | * Check if this tar archive contains a specific directory |
497 | - * | |
497 | + * | |
498 | 498 | * @param string $dirname |
499 | 499 | * @return bool |
500 | 500 | **/ |
@@ -512,7 +512,7 @@ class tar | ||
512 | 512 | |
513 | 513 | /** |
514 | 514 | * Add a directory to this tar archive |
515 | - * | |
515 | + * | |
516 | 516 | * @param string $dirname |
517 | 517 | * @return bool |
518 | 518 | **/ |
@@ -540,7 +540,7 @@ class tar | ||
540 | 540 | |
541 | 541 | /** |
542 | 542 | * Add a file to the tar archive |
543 | - * | |
543 | + * | |
544 | 544 | * @param string $filename |
545 | 545 | * @param boolean $binary Binary file? |
546 | 546 | * @return bool |
@@ -581,14 +581,16 @@ class tar | ||
581 | 581 | $activeFile["checksum"] = isset($checksum) ? $checksum : ''; |
582 | 582 | $activeFile["user_name"] = ""; |
583 | 583 | $activeFile["group_name"] = ""; |
584 | - $activeFile["file"] = trim($file_contents); | |
584 | + // "trim" May be needless. by nao-pon | |
585 | + //$activeFile["file"] = trim($file_contents); | |
586 | + $activeFile["file"] = $file_contents; | |
585 | 587 | |
586 | 588 | return true; |
587 | 589 | } |
588 | 590 | |
589 | 591 | /** |
590 | 592 | * Remove a file from the tar archive |
591 | - * | |
593 | + * | |
592 | 594 | * @param string $filename |
593 | 595 | * @return bool |
594 | 596 | **/ |
@@ -608,7 +610,7 @@ class tar | ||
608 | 610 | |
609 | 611 | /** |
610 | 612 | * Remove a directory from the tar archive |
611 | - * | |
613 | + * | |
612 | 614 | * @param string $dirname |
613 | 615 | * @return bool |
614 | 616 | **/ |
@@ -628,8 +630,8 @@ class tar | ||
628 | 630 | |
629 | 631 | /** |
630 | 632 | * Write the currently loaded tar archive to disk |
631 | - * | |
632 | - * @return bool | |
633 | + * | |
634 | + * @return bool | |
633 | 635 | **/ |
634 | 636 | function saveTar() |
635 | 637 | { |
@@ -645,7 +647,7 @@ class tar | ||
645 | 647 | |
646 | 648 | /** |
647 | 649 | * Saves tar archive to a different file than the current file |
648 | - * | |
650 | + * | |
649 | 651 | * @param string $filename |
650 | 652 | * @param bool $useGzip Use GZ compression? |
651 | 653 | * @return bool |
@@ -681,7 +683,7 @@ class tar | ||
681 | 683 | |
682 | 684 | /** |
683 | 685 | * Sends tar archive to stdout |
684 | - * | |
686 | + * | |
685 | 687 | * @param string $filename |
686 | 688 | * @param bool $useGzip Use GZ compression? |
687 | 689 | * @return string |