id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	modified_flg
331	SC_Utils::sfEncodeFileで無限ループする可能性	adachi	nanasess	"SC_Utils::sfEncodeFile()で、ファイルポインタのチェックを行っていないため、
無限ループになる場合がある。

http://jp.php.net/manual/ja/function.feof.php

{{{
    function sfEncodeFile($filepath, $enc_type, $out_dir) {
        $ifp = fopen($filepath, ""r"");

        $basename = basename($filepath);
        $outpath = $out_dir . ""enc_"" . $basename;

        $ofp = fopen($outpath, ""w+"");

        while(!feof($ifp)) { // $ifpがfalseの場合がある
            $line = fgets($ifp);
            $line = mb_convert_encoding($line, $enc_type, ""auto"");
            fwrite($ofp,  $line);
        }

        fclose($ofp);
        fclose($ifp);

        return     $outpath;
    }
}}}"	バグ指摘	closed	中	EC-CUBE2.3.0	フロント	2.1.2(正式版)	修正済	SC_Utils sfEncodeFile 無限ループ		
