From 4ee0fd5c54284ae557b02a1c0a5c0ac03b2c8817 Mon Sep 17 00:00:00 2001 From: SIR Date: Wed, 12 Nov 2014 15:01:29 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B1=EC=8A=AC=EC=B5=9C=EC=94=A8=EB=8B=98?= =?UTF-8?q?=EC=9D=B4=20=EC=8B=A0=EA=B3=A0=ED=95=9C=20url=5Fauto=5Flink?= =?UTF-8?q?=EC=97=90=20=ED=8A=B9=EC=88=98=EB=AC=B8=EC=9E=90=20]=20?= =?UTF-8?q?=EA=B0=80=20=ED=8F=AC=ED=95=A8=EB=90=98=EB=8A=94=20=ED=98=84?= =?UTF-8?q?=EC=83=81=20=ED=95=B4=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index fd2999fc8..8efac16b0 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -141,7 +141,7 @@ function get_cookie($cookie_name) { $cookie = md5($cookie_name); if (array_key_exists($cookie, $_COOKIE)) - return base64_decode($_COOKIE[$cookie]); + return base64_decode($_COOKIE[md5($cookie_name)]); else return ""; } @@ -214,11 +214,12 @@ function url_auto_link($str) // 140326 유창화님 제안코드로 수정 // http://sir.co.kr/bbs/board.php?bo_table=pg_lecture&wr_id=461 // http://sir.co.kr/bbs/board.php?bo_table=pg_lecture&wr_id=463 - $str = str_replace(array("<", ">", "&", """, " "), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t"), $str); - $str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "\\1", $str); - $str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1\\2", $str); - $str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "\\0", $str); - $str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t"), array(" ", "<", ">"), $str); + $str = str_replace(array("<", ">", "&", """, " ", "'"), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t", "'"), $str); + //$str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "\\1", $str); + $str = preg_replace("/([^(href=\"?'?)|(src=\"?'?)]|\(|^)((http|https|ftp|telnet|news|mms):\/\/[a-zA-Z0-9\.-]+\.[가-힣\xA1-\xFEa-zA-Z0-9\.:&#=_\?\/~\+%@;\-\|\,\(\)]+)/i", "\\1\\2", $str); + $str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1\\2", $str); + $str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "\\0", $str); + $str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t", "'"), array(" ", "<", ">", "'"), $str); /* // 속도 향상 031011 @@ -528,7 +529,6 @@ function conv_content($content, $html, $filter=true) $content = str_replace("\n ", "\n ", $content); $content = get_text($content, 1); - $content = url_auto_link($content); }