1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-13 03:54:57 +01:00

tiny alterations

git-svn-id: file:///svn/phpbb/trunk@6846 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-01-06 19:37:09 +00:00
parent 962be6ed09
commit 48b76be50b
4 changed files with 26 additions and 5 deletions

View File

@ -2580,7 +2580,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
{
$get_info = true;
}
else if (strpos($line, '404 Not Found') !== false)
else if (stripos($line, '404 not found') !== false)
{
$errstr = $user->lang['FILE_NOT_FOUND'] . ': ' . $filename;
return false;
@ -2593,11 +2593,13 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
{
if ($errstr)
{
// convert possible localized errstr to utf8
// $errstr = utf8_convert_message($errstr);
return false;
}
else
{
$errstr = 'fsock disabled';
$errstr = $user->lang['FSOCK_DISABLED'];
return false;
}
}

View File

@ -821,6 +821,11 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '')
// Ok we have error checked as much as we can to this point let's get on it already.
if (!$smtp->socket = @fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20))
{
if ($errstr)
{
$errstr = utf8_convert_message($errstr);
}
$err_msg = (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr";
return false;
}
@ -1062,6 +1067,11 @@ class smtp_class
// able to get our ip for matching...
if (!$this->socket = @fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 10))
{
if ($errstr)
{
$errstr = utf8_convert_message($errstr);
}
$err_msg = (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr";
return $err_msg;
}
@ -1152,6 +1162,11 @@ class smtp_class
if (!$this->socket = @fsockopen($hostname, 110, $errno, $errstr, 10))
{
if ($errstr)
{
$errstr = utf8_convert_message($errstr);
}
return (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr";
}

View File

@ -649,6 +649,9 @@ class fileupload
$filename = $url['path'];
$filesize = 0;
$errno = 0;
$errstr = '';
if (!($fsock = @fsockopen($host, $port, $errno, $errstr)))
{
$file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']);
@ -677,11 +680,11 @@ class fileupload
}
else
{
if (strpos($line, 'Content-Type: ') !== false)
if (stripos($line, 'content-type: ') !== false)
{
$upload_ary['type'] = rtrim(str_replace('Content-Type: ', '', $line));
$upload_ary['type'] = rtrim(str_replace('content-type: ', '', strtolower($line)));
}
else if (strpos($line, '404 Not Found') !== false)
else if (stripos($line, '404 not found') !== false)
{
$file = new fileerror($user->lang[$this->error_prefix . 'URL_NOT_FOUND']);
return $file;

View File

@ -175,6 +175,7 @@ $lang = array_merge($lang, array(
'FORUM_RULES' => 'Forum rules',
'FORUM_RULES_LINK' => 'Please click to view the forum rules',
'FROM' => 'from',
'FSOCK_DISABLED' => 'The operation is not able to be completed because the fsock functions has been disabled or the server being queried could not be found.',
'FTP_FSOCK_HOST' => 'FTP host',
'FTP_FSOCK_HOST_EXPLAIN' => 'FTP server used to connect your site',