Skip to content

Commit 7350294

Browse files
committed
fixed that iconv workaround
had a little logic error there - need to preserve the original string to retry the encoding a second time
1 parent aa9ae83 commit 7350294

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Zip.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,9 @@ protected function utf8ToCp($string)
655655
{
656656
// try iconv first
657657
if (function_exists('iconv')) {
658-
$string = @iconv('UTF-8', 'CP437//IGNORE', $string);
658+
$conv = @iconv('UTF-8', 'CP437//IGNORE', $string);
659+
if($conv) return $conv; // it worked
659660
}
660-
if($string) return $string; // it worked
661661

662662
// still here? iconv failed to convert the string. Try another method
663663
// see http://php.net/manual/en/function.iconv.php#108643

0 commit comments

Comments
 (0)