1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-10-11 21:34:39 +02:00

Update README

This commit is contained in:
wapplay-home-linux
2017-03-15 10:42:46 +03:00
parent 0dbdc0faeb
commit 3ab98532a0
12 changed files with 228 additions and 228 deletions

View File

@@ -168,8 +168,7 @@ abstract class ZipAbstractEntry implements ZipEntry
if (0x0000 > $length || $length > 0xffff) {
throw new ZipException('Illegal zip entry name parameter');
}
$encoding = mb_detect_encoding($this->name, "ASCII, UTF-8", true);
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, $encoding === 'UTF-8');
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, true);
$this->name = $name;
return $this;
}
@@ -792,10 +791,7 @@ abstract class ZipAbstractEntry implements ZipEntry
throw new ZipException("Comment too long");
}
}
$encoding = mb_detect_encoding($this->name, "ASCII, UTF-8", true);
if ($encoding === 'UTF-8') {
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, true);
}
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, true);
$this->comment = $comment;
return $this;
}
@@ -853,7 +849,7 @@ abstract class ZipAbstractEntry implements ZipEntry
public function setPassword($password, $encryptionMethod = null)
{
$this->password = $password;
if ($encryptionMethod !== null) {
if (null !== $encryptionMethod) {
$this->setEncryptionMethod($encryptionMethod);
}
$this->setEncrypted(!empty($this->password));