mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Fixed Binary-unsafe 'fopen(...)' usage (#84)
This commit is contained in:
parent
c9bcb37222
commit
1b935b8776
@ -252,7 +252,7 @@ if ($check_upload)
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) )
|
||||
if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'wb')) )
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $attach_config['upload_dir']) . '<br />';
|
||||
@ -441,7 +441,7 @@ if ($check_image_cat)
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) )
|
||||
if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'wb')) )
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $upload_dir) . '<br />';
|
||||
|
@ -110,7 +110,7 @@ class emailer
|
||||
}
|
||||
}
|
||||
|
||||
if (!($fd = @fopen($tpl_file, 'r')))
|
||||
if (!($fd = @fopen($tpl_file, 'rb')))
|
||||
{
|
||||
bb_die('Failed opening template file :: ' . $tpl_file);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ function create_atom ($file_path, $mode, $id, $title, $topics)
|
||||
}
|
||||
$atom .= "</feed>";
|
||||
@unlink($file_path);
|
||||
$fp = fopen($file_path, "w");
|
||||
$fp = fopen($file_path, "wb");
|
||||
fwrite($fp, $atom);
|
||||
fclose ($fp);
|
||||
return true;
|
||||
|
@ -268,7 +268,7 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
|
||||
if ($bb_cfg['bt_disable_dht'])
|
||||
{
|
||||
$tor['info']['private'] = (int) 1;
|
||||
$fp = fopen($filename, 'w+');
|
||||
$fp = fopen($filename, 'wb+');
|
||||
fwrite ($fp, bencode($tor));
|
||||
fclose ($fp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user