mirror of
https://github.com/Mibew/design.git
synced 2025-01-22 18:10:33 +03:00
fix move_uploaded_file errors
This commit is contained in:
parent
dd6632ffdf
commit
c50d60730c
@ -3,27 +3,26 @@
|
||||
<component name="ProjectCodeStyleSettingsManager">
|
||||
<option name="PER_PROJECT_SETTINGS">
|
||||
<value>
|
||||
<XML>
|
||||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
||||
</XML>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="sass">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="yml">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<codeStyleSettings language="JavaScript">
|
||||
<indentOptions>
|
||||
<option name="OTHER_INDENT_OPTIONS">
|
||||
<value>
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="true" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</value>
|
||||
</option>
|
||||
<codeStyleSettings language="PHP">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="USE_TAB_CHARACTER" value="true" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
</value>
|
||||
</option>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
|
@ -349,7 +349,7 @@ function connect()
|
||||
die('Mysql extension is not loaded');
|
||||
}
|
||||
$link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass)
|
||||
or die('Could not connect: ' . mysql_error());
|
||||
or die('Could not connect: ' . mysql_error());
|
||||
mysql_select_db($mysqldb, $link) or die('Could not select database');
|
||||
if ($force_charset_in_connection) {
|
||||
mysql_query("SET NAMES '$dbencoding'", $link);
|
||||
@ -392,7 +392,7 @@ function db_build_select($fields, $table, $conditions, $orderandgroup)
|
||||
function db_rows_count($table, $conditions, $countfields, $link)
|
||||
{
|
||||
$result = mysql_query(db_build_select("count(" . ($countfields ? $countfields : "*") . ")", $table, $conditions, ""), $link)
|
||||
or die(' Count query failed: ' . mysql_error($link));
|
||||
or die(' Count query failed: ' . mysql_error($link));
|
||||
$line = mysql_fetch_array($result, MYSQL_NUM);
|
||||
mysql_free_result($result);
|
||||
return $line[0];
|
||||
@ -542,9 +542,9 @@ function get_app_location($showhost, $issecure)
|
||||
function is_secure_request()
|
||||
{
|
||||
return
|
||||
isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443'
|
||||
|| isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"
|
||||
|| isset($_SERVER["HTTP_HTTPS"]) && $_SERVER["HTTP_HTTPS"] == "on";
|
||||
isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443'
|
||||
|| isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"
|
||||
|| isset($_SERVER["HTTP_HTTPS"]) && $_SERVER["HTTP_HTTPS"] == "on";
|
||||
}
|
||||
|
||||
function get_month_selection($fromtime, $totime)
|
||||
@ -713,7 +713,7 @@ function print_csrf_token_input()
|
||||
{
|
||||
setcsrftoken();
|
||||
|
||||
echo "<input name='csrf_token' type='hidden' value='" . $_SESSION['csrf_token'] . "' />";
|
||||
echo "<input name='csrf_token' type='hidden' value='" . $_SESSION['csrf_token'] . "' />\n";
|
||||
}
|
||||
|
||||
/* print csrf token in url format */
|
||||
|
@ -45,7 +45,7 @@ if (!$op) {
|
||||
$errors[] = getlocal('page_agent.cannot_modify');
|
||||
|
||||
} else if (isset($_FILES['avatarFile']) && $_FILES['avatarFile']['name']) {
|
||||
$valid_types = array("gif", "jpg", "png", "tif");
|
||||
$valid_types = array("gif", "jpg", "png", "tif", "jpeg");
|
||||
|
||||
$orig_filename = $_FILES['avatarFile']['name'];
|
||||
$tmp_file_name = $_FILES['avatarFile']['tmp_name'];
|
||||
@ -65,7 +65,7 @@ if (!$op) {
|
||||
if (file_exists($full_file_path)) {
|
||||
unlink($full_file_path);
|
||||
}
|
||||
if (!move_uploaded_file($_FILES['avatarFile']['tmp_name'], $full_file_path)) {
|
||||
if (!@move_uploaded_file($_FILES['avatarFile']['tmp_name'], $full_file_path)) {
|
||||
$errors[] = failed_uploading_file($orig_filename, "errors.file.move.error");
|
||||
} else {
|
||||
$avatar = "$webimroot/images/avatar/$new_file_name";
|
||||
|
Loading…
Reference in New Issue
Block a user