";
}
@@ -1454,7 +1454,7 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR)
$sql = preg_replace("#^select.*from.*where.*`?information_schema`?.*#i", "select 1", $sql);
if ($error)
- $result = @mysql_query($sql, $g5['connect_db']) or die("$sql
" . mysql_errno() . " : " . mysql_error() . "
error file : {$_SERVER['PHP_SELF']}");
+ $result = @mysql_query($sql, $g5['connect_db']) or die("
$sql
" . mysql_errno() . " : " . mysql_error() . "
error file : {$_SERVER['SCRIPT_NAME']}");
else
$result = @mysql_query($sql, $g5['connect_db']);
@@ -1466,7 +1466,7 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR)
function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR)
{
$result = sql_query($sql, $error);
- //$row = @sql_fetch_array($result) or die("
$sql
" . mysql_errno() . " : " . mysql_error() . "
error file : $_SERVER['PHP_SELF']");
+ //$row = @sql_fetch_array($result) or die("
$sql
" . mysql_errno() . " : " . mysql_error() . "
error file : $_SERVER['SCRIPT_NAME']");
$row = sql_fetch_array($result);
return $row;
}
@@ -2886,7 +2886,7 @@ function clean_query_string($query, $amp=true)
$q = array();
foreach($out as $key=>$val) {
- $key = trim($key);
+ $key = strip_tags(trim($key));
$val = trim($val);
switch($key) {
@@ -2958,4 +2958,38 @@ function clean_query_string($query, $amp=true)
return $str;
}
+
+function get_device_change_url()
+{
+ $p = parse_url(G5_URL);
+ $href = $p['scheme'].'://'.$p['host'];
+ if(isset($p['port']) && $p['port'])
+ $href .= ':'.$p['port'];
+ $href .= $_SERVER['SCRIPT_NAME'];
+
+ $q = array();
+ $device = 'device='.(G5_IS_MOBILE ? 'pc' : 'mobile');
+
+ if($_SERVER['QUERY_STRING']) {
+ foreach($_GET as $key=>$val) {
+ if($key == 'device')
+ continue;
+
+ $key = strip_tags($key);
+ $val = strip_tags($val);
+
+ if($key && $val)
+ $q[$key] = $val;
+ }
+ }
+
+ if(!empty($q)) {
+ $query = http_build_query($q, '', '&');
+ $href .= '?'.$query.'&'.$device;
+ } else {
+ $href .= '?'.$device;
+ }
+
+ return $href;
+}
?>
\ No newline at end of file
diff --git a/lib/mailer.lib.php b/lib/mailer.lib.php
index a149931b7..42593a3c3 100644
--- a/lib/mailer.lib.php
+++ b/lib/mailer.lib.php
@@ -5,16 +5,16 @@ include_once(G5_PHPMAILER_PATH.'/class.phpmailer.php');
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
-function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
-{
- global $config;
- global $g5;
+function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
+{
+ global $config;
+ global $g5;
- // 메일발송 사용을 하지 않는다면
- if (!$config['cf_email_use']) return;
+ // 메일발송 사용을 하지 않는다면
+ if (!$config['cf_email_use']) return;
- if ($type != 1)
- $content = nl2br($content);
+ if ($type != 1)
+ $content = nl2br($content);
$mail = new PHPMailer(); // defaults to using php "mail()"
if (defined('G5_SMTP') && G5_SMTP) {
@@ -27,13 +27,13 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
$mail->AltBody = ""; // optional, comment out and test
$mail->MsgHTML($content);
$mail->AddAddress($to);
- if ($cc)
+ if ($cc)
$mail->AddCC($cc);
- if ($bcc)
+ if ($bcc)
$mail->AddBCC($bcc);
//print_r2($file); exit;
- if ($file != "") {
- foreach ($file as $f) {
+ if ($file != "") {
+ foreach ($file as $f) {
$mail->AddAttachment($f['path'], $f['name']);
}
}
@@ -61,27 +61,27 @@ function attach_file($filename, $tmp_name)
/*
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
-function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
-{
- global $config;
- global $g5;
+function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
+{
+ global $config;
+ global $g5;
- // 메일발송 사용을 하지 않는다면
- if (!$config['cf_email_use']) return;
+ // 메일발송 사용을 하지 않는다면
+ if (!$config['cf_email_use']) return;
- $boundary = uniqid(time());
+ $boundary = uniqid(time());
$header = "Message-ID: <".generate_mail_id(preg_replace("/@.+$/i","",$to)).">\r\n".
"From:=?utf-8?B?".base64_encode($fname)."?=<$fmail>\r\n";
- if ($cc) $header .= "Cc: $cc\n";
- if ($bcc) $header .= "Bcc: $bcc\n";
- $header .= "MIME-Version: 1.0\n";
- $header .= "X-Mailer: SIR Mailer 0.94 : {$_SERVER['SERVER_ADDR']} : {$_SERVER['REMOTE_ADDR']} : ".G5_URL." : {$_SERVER['PHP_SELF']} : {$_SERVER['HTTP_REFERER']} \n";
+ if ($cc) $header .= "Cc: $cc\n";
+ if ($bcc) $header .= "Bcc: $bcc\n";
+ $header .= "MIME-Version: 1.0\n";
+ $header .= "X-Mailer: SIR Mailer 0.94 : {$_SERVER['SERVER_ADDR']} : {$_SERVER['REMOTE_ADDR']} : ".G5_URL." : {$_SERVER['SCRIPT_NAME']} : {$_SERVER['HTTP_REFERER']} \n";
$header .= "Date: ".date ("D, j M Y H:i:s T",time())."\r\n".
"To: $to\r\n".
"Subject: =?utf-8?B?".base64_encode($subject)."?=\r\n";
- if ($file == "") {
+ if ($file == "") {
$header .= "Content-Type: MULTIPART/ALTERNATIVE;\n".
" BOUNDARY=\"$boundary\"\n\n";
} else {
@@ -89,39 +89,39 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
" BOUNDARY=\"$boundary\"\n\n";
}
- if ($type == 2)
- $content = nl2br($content);
+ if ($type == 2)
+ $content = nl2br($content);
$strip_content = stripslashes(trim($content));
$encode_content = chunk_split(base64_encode($strip_content));
$body = "";
$body .= "\n--$boundary\n";
- $body .= "Content-Type: TEXT/PLAIN; charset=utf-8\n";
- $body .= "Content-Transfer-Encoding: BASE64\n\n";
- $body .= $encode_content;
+ $body .= "Content-Type: TEXT/PLAIN; charset=utf-8\n";
+ $body .= "Content-Transfer-Encoding: BASE64\n\n";
+ $body .= $encode_content;
$body .= "\n--$boundary\n";
- if ($type) {
- $body .= "Content-Type: TEXT/HTML; charset=utf-8\n";
- $body .= "Content-Transfer-Encoding: BASE64\n\n";
- $body .= $encode_content;
+ if ($type) {
+ $body .= "Content-Type: TEXT/HTML; charset=utf-8\n";
+ $body .= "Content-Transfer-Encoding: BASE64\n\n";
+ $body .= $encode_content;
$body .= "\n--$boundary\n";
}
- if ($file != "") {
- foreach ($file as $f) {
- $body .= "n--$boundary\n";
- $body .= "Content-Type: APPLICATION/OCTET-STREAM; name=$fname\n";
- $body .= "Content-Transfer-Encoding: BASE64\n";
- $body .= "Content-Disposition: inline; filename=$fname\n";
+ if ($file != "") {
+ foreach ($file as $f) {
+ $body .= "n--$boundary\n";
+ $body .= "Content-Type: APPLICATION/OCTET-STREAM; name=$fname\n";
+ $body .= "Content-Transfer-Encoding: BASE64\n";
+ $body .= "Content-Disposition: inline; filename=$fname\n";
- $body .= "\n";
- $body .= chunk_split(base64_encode($f['data']));
- $body .= "\n";
- }
- $body .= "--$boundary--\n";
- }
+ $body .= "\n";
+ $body .= chunk_split(base64_encode($f['data']));
+ $body .= "\n";
+ }
+ $body .= "--$boundary--\n";
+ }
$mails['to'] = $to;
$mails['from'] = $fmail;
@@ -129,7 +129,7 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
if (defined(G5_SMTP)) {
ini_set('SMTP', G5_SMTP);
- @mail($to, $subject, $body, $header, "-f $fmail");
+ @mail($to, $subject, $body, $header, "-f $fmail");
} else {
new maildaemon($mails);
}
@@ -306,7 +306,7 @@ class maildaemon {
# $t -> 1 (debug of socket open,close)
# 0 (regular smtp message)
# $p -> 1 (print detail debug)
- #
+ #
# return 1 -> success
# return 0 -> failed
#
@@ -381,7 +381,7 @@ function generate_mail_id($uid) {
function mail_header($to,$from,$title,$mta=0) {
global $langs,$boundary;
- # mail header 를 작성
+ # mail header 를 작성
$boundary = get_boundary_msg();
$header = "Message-ID: <".generate_mail_id(preg_replace("/@.+$/i","",$to)).">\r\n".
"From:=?utf-8?B?".base64_encode('보내는사람')."?=<$from>\r\n".
diff --git a/mobile/skin/faq/basic/list.skin.php b/mobile/skin/faq/basic/list.skin.php
index d64a533a1..f625ff36a 100644
--- a/mobile/skin/faq/basic/list.skin.php
+++ b/mobile/skin/faq/basic/list.skin.php
@@ -73,7 +73,7 @@ if( count($faq_master_list) ){
?>
-
+
',
-
+
\ No newline at end of file
diff --git a/mobile/tail.php b/mobile/tail.php
index ceecca3fd..44d88ff22 100644
--- a/mobile/tail.php
+++ b/mobile/tail.php
@@ -25,30 +25,8 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$val) {
- if($key == 'device')
- continue;
-
- $href .= $sep.$key.'='.$val;
- $sep = '&';
- $seq++;
- }
- }
- if($seq)
- $href .= '&device=pc';
- else
- $href .= '?device=pc';
-?>
-