diff --git a/classes/mobile/Mobile.class.php b/classes/mobile/Mobile.class.php
index 5eb750c24..5e3972ca8 100644
--- a/classes/mobile/Mobile.class.php
+++ b/classes/mobile/Mobile.class.php
@@ -46,11 +46,11 @@ class Mobile
// Try to detect from URL arguments and cookies, and finally fall back to user-agent detection.
$m = Context::get('m');
$cookie = (isset($_COOKIE['mobile']) && $_SESSION['user_agent'] === md5($_SERVER['HTTP_USER_AGENT'])) ? $_COOKIE['mobile'] : null;
- if ($m === '1' || $cookie === 'true')
+ if ($m === '1' || ($m === null && $cookie === 'true'))
{
self::$_ismobile = TRUE;
}
- elseif ($m === '0' || $cookie === 'false')
+ elseif ($m === '0' || ($m === null && $cookie === 'false'))
{
self::$_ismobile = FALSE;
}
@@ -60,7 +60,7 @@ class Mobile
}
// Set cookie to prevent recalculation.
- if (!$cookie)
+ if ($cookie !== (self::$_ismobile ? 'true' : 'false'))
{
$_SESSION['user_agent'] = md5($_SERVER['HTTP_USER_AGENT']);
$_COOKIE['mobile'] = self::$_ismobile ? 'true' : 'false';
diff --git a/common/framework/parsers/langparser.php b/common/framework/parsers/langparser.php
index 756201fdb..2f868edef 100644
--- a/common/framework/parsers/langparser.php
+++ b/common/framework/parsers/langparser.php
@@ -58,7 +58,7 @@ class LangParser
}
// Load the XML lang file.
- $xml = @simplexml_load_file($filename);
+ $xml = simplexml_load_string(Storage::read($filename));
if ($xml === false)
{
Storage::write($output_filename, '');
diff --git a/common/framework/storage.php b/common/framework/storage.php
index 969d880d9..88367e8bc 100644
--- a/common/framework/storage.php
+++ b/common/framework/storage.php
@@ -240,11 +240,16 @@ class Storage
}
}
- if (self::$safe_overwrite && strncasecmp($mode, 'a', 1))
+ if (self::$safe_overwrite && strncasecmp($mode, 'a', 1) && @is_writable($destination_dir))
{
+ $use_atomic_rename = true;
$original_filename = $filename;
$filename = $filename . '.tmp.' . microtime(true);
}
+ else
+ {
+ $use_atomic_rename = false;
+ }
if ($fp = @fopen($filename, $mode))
{
@@ -275,7 +280,7 @@ class Storage
@chmod($filename, ($perms === null ? (0666 & ~self::getUmask()) : $perms));
- if (self::$safe_overwrite && strncasecmp($mode, 'a', 1))
+ if ($use_atomic_rename)
{
$rename_success = @rename($filename, $original_filename);
if (!$rename_success)
@@ -350,14 +355,20 @@ class Storage
}
elseif (self::isDirectory($destination))
{
+ $destination_dir = $destination;
$destination = $destination . '/' . basename($source);
}
- if (self::$safe_overwrite)
+ if (self::$safe_overwrite && @is_writable($destination_dir))
{
+ $use_atomic_rename = true;
$original_destination = $destination;
$destination = $destination . '.tmp.' . microtime(true);
}
+ else
+ {
+ $use_atomic_rename = false;
+ }
$copy_success = @copy($source, $destination);
if (!$copy_success)
@@ -382,7 +393,7 @@ class Storage
@chmod($destination, $destination_perms);
}
- if (self::$safe_overwrite)
+ if ($use_atomic_rename)
{
$rename_success = @rename($destination, $original_destination);
if (!$rename_success)
diff --git a/modules/board/board.view.php b/modules/board/board.view.php
index 43761aa77..6c5dab7ce 100644
--- a/modules/board/board.view.php
+++ b/modules/board/board.view.php
@@ -821,7 +821,7 @@ class boardView extends board
}
// if the document is not existed, then back to the board content page
- if(!$oDocument->isExists())
+ if(!$oDocument || !$oDocument->isExists())
{
return $this->dispBoardContent();
}
diff --git a/modules/member/lang/en.php b/modules/member/lang/en.php
index e3ce7b070..9e48d9c7c 100644
--- a/modules/member/lang/en.php
+++ b/modules/member/lang/en.php
@@ -48,6 +48,7 @@ $lang->enable_find_account_question = 'Account recovery using question/answer';
$lang->enable_ssl = 'Enable SSL';
$lang->msg_email_confirmation_required = 'A confirmation e-mail will be sent. Please check your email address carefully.';
$lang->security_sign_in = 'Sign in using enhanced security';
+$lang->member_limited = 'Limited';
$lang->limit_day = 'Temporary Limit Date';
$lang->limit_day_description = 'Description for Temporary Limit Date';
$lang->limit_date = 'Limit Date';
diff --git a/modules/member/lang/ko.php b/modules/member/lang/ko.php
index 15e71a0b2..5497ddaa8 100644
--- a/modules/member/lang/ko.php
+++ b/modules/member/lang/ko.php
@@ -48,6 +48,7 @@ $lang->enable_find_account_question = '질문/답변 인증 사용';
$lang->enable_ssl = 'SSL 기능 사용';
$lang->msg_email_confirmation_required = '인증 메일이 발송되니 정확하게 입력해 주시기 바랍니다.';
$lang->security_sign_in = '보안로그인 사용';
+$lang->member_limited = '임시 제한';
$lang->limit_day = '임시 제한 일자';
$lang->limit_day_description = '임시 제한 일자 설명';
$lang->limit_date = '제한일';
diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php
index 51e9c6cdc..915a25a04 100644
--- a/modules/member/member.controller.php
+++ b/modules/member/member.controller.php
@@ -1756,13 +1756,16 @@ class memberController extends member
$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
}
- return new Object(-1, ($this->memberInfo->refused_reason)? lang('msg_user_denied') . "\n" . $this->memberInfo->refused_reason : 'msg_user_denied');
+
+ $refused_reason = $this->memberInfo->refused_reason ? ('
' . lang('refused_reason') . ': ' . $this->memberInfo->refused_reason) : '';
+ return new Object(-1, lang('msg_user_denied') . $refused_reason);
}
// Notify if user is limited
if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd"))
{
- return new Object(-9,sprintf(lang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
+ $limited_reason = $this->memberInfo->limited_reason ? ('
' . lang('refused_reason') . ': ' . $this->memberInfo->limited_reason) : '';
+ return new Object(-9, sprintf(lang('msg_user_limited'), zdate($this->memberInfo->limit_date,"Y-m-d")) . $limited_reason);
}
// Do not allow login as admin if not in allowed IP list
diff --git a/modules/member/tpl/insert_member.html b/modules/member/tpl/insert_member.html
index 861826f18..dd8da7963 100644
--- a/modules/member/tpl/insert_member.html
+++ b/modules/member/tpl/insert_member.html
@@ -92,6 +92,13 @@
{$lang->about_limit_date}
+