Changeset 2734
- Timestamp:
- May 8, 2007, 9:10:13 PM (16 years ago)
- Location:
- OpenPNE/branches/2.8.x
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE/branches/2.8.x/webapp/lib/OpenPNE/Config.php
r2659 r2734 166 166 'ADMIN_INIT_CONFIG' => true, 167 167 'SERVER_IP_KEY' => 'REMOTE_ADDR', 168 'OPENPNE_USE_CMD_TAG' => true,169 168 'OPENPNE_USE_FUNCTION_CACHE' => false, 170 169 'OPENPNE_USE_MYSQL_HINT' => false, -
OpenPNE/branches/2.8.x/webapp/lib/smarty_plugins/modifier.t_cmd.php
r2651 r2734 11 11 } 12 12 13 $regexp = '/<cmd\s+src= "(\w+)"(?:\s+args="([\w\-\+%]+(,[\w\-\+%]+)*)?")?\s*>/i';13 $regexp = '/<cmd\s+src="(\w+)"(?:\s+args="([a-zA-Z0-9_\-+%]+(,[a-zA-Z0-9_\-+%]+)*)?")?\s*>/i'; 14 14 $GLOBALS['_CMD']['type'] = $type; 15 15 16 16 return preg_replace_callback($regexp, '_smarty_modifier_t_cmd_make_js', $string); 17 18 17 } 19 18 -
OpenPNE/branches/2.8.x/webapp/lib/smarty_plugins/modifier.t_url2a.php
r2543 r2734 13 13 function smarty_modifier_t_url2a($string) 14 14 { 15 // "(") と '(') を元に戻す 16 $search = array('"', '''); 17 $replace = array('"', "'"); 18 $string = str_replace($search, $replace, $string); 19 20 $url_pattern = '/https?:\/\/[\w\-.,:;\~\^\/?\@&=+\$%#!()]+/'; 15 $url_pattern = '/https?:\/\/(?:[a-zA-Z0-9_\-\/.,:;~?@=+$%#!()]|&)+/'; 21 16 return preg_replace_callback($url_pattern, 'smarty_modifier_t_url2a_callback', $string); 22 17 } … … 24 19 function smarty_modifier_t_url2a_callback($matches) 25 20 { 26 return pne_url2a($matches[0]); 21 $url = str_replace('&', '&', $matches[0]); 22 return pne_url2a($url); 27 23 } 28 24 -
OpenPNE/branches/2.8.x/webapp/lib/smarty_plugins/modifier.t_url2a_ktai.php
r2180 r2734 13 13 function smarty_modifier_t_url2a_ktai($string) 14 14 { 15 // "(") と '(') を元に戻す 16 $search = array('"', '''); 17 $replace = array('"', "'"); 18 $string = str_replace($search, $replace, $string); 15 $parts = parse_url(OPENPNE_URL); 16 $openpne_url = $parts['host'] . $parts['path']; 19 17 20 // "(&) と '(&) を元に戻す 21 $search = array('&', '&;'); 22 $replace = array('&', "&"); 23 $string = str_replace($search, $replace, $string); 24 25 $url_pattern = '/https?:\/\/(.*)\?m=ktai&a=page_[\w\-.,:;\~\^\/?\@&=+\$%#!()]+/'; 18 $url_pattern = sprintf('/https?:\/\/%s\?m=pc&a=(page_fh_diary(?:[a-zA-Z0-9_=]|&)*)/', preg_quote($openpne_url, '/')); 26 19 return preg_replace_callback($url_pattern, 'smarty_modifier_t_url2a_ktai_callback', $string); 27 20 } … … 29 22 function smarty_modifier_t_url2a_ktai_callback($matches) 30 23 { 31 $target = str_replace('https://', '', OPENPNE_URL); 32 $target = str_replace('http://', '', $target); 33 if ($matches[1] == $target) { 34 return pne_url2a($matches[0]); 35 } else { 36 return $matches[0]; 24 $url = str_replace('&', '&', $matches[0]); 25 26 // 携帯用URLに置換、ksid 追加 27 $ktai_url = str_replace('?m=pc', '?m=ktai', $url) . '&' . $GLOBALS['KTAI_URL_TAIL']; 28 29 // 表示上は page_ 以降を最大40文字で縮める 30 $urlstr = str_replace('&', '&', $matches[1]); 31 32 $length = 40; 33 $etc = '..'; 34 35 if (strlen($urlstr) > $length) { 36 $length -= strlen($etc); 37 $urlstr = substr($urlstr, 0, $length) . $etc; 37 38 } 39 40 $ktai_url = htmlspecialchars($ktai_url, ENT_QUOTES, 'UTF-8'); 41 $urlstr = htmlspecialchars($urlstr, ENT_QUOTES, 'UTF-8'); 42 43 return sprintf('<a href="%s">%s</a>', $ktai_url, $urlstr); 38 44 } 39 45 -
OpenPNE/branches/2.8.x/webapp/lib/smarty_plugins/modifier.t_url2cmd.php
r2557 r2734 7 7 function smarty_modifier_t_url2cmd($string, $type = '') 8 8 { 9 // "(") と '(') を元に戻す 10 $search = array('"', '''); 11 $replace = array('"', "'"); 12 $string = str_replace($search, $replace, $string); 13 14 $url_pattern = "/https?:\/\/([a-zA-Z0-9\-.]+)\/?[\w\-.,:;\~\^\/?\@&=+\$%#!()]*/"; 9 $url_pattern = '/https?:\/\/([a-zA-Z0-9\-.]+)\/?(?:[a-zA-Z0-9_\-\/.,:;~?@=+$%#!()]|&)*/'; 15 10 $GLOBALS['_CMD']['type'] = $type; 16 11 … … 20 15 function _smarty_modifier_t_cmd_make_url_js($matches) 21 16 { 22 $url = $matches[0];17 $url = str_replace('&', '&', $matches[0]); 23 18 $file = $matches[1] . '.js'; 24 19 $path = './cmd/' . $file; … … 26 21 if (!OPENPNE_USE_CMD_TAG || !db_is_use_cmd($matches[1], $GLOBALS['_CMD']['type']) || !is_readable($path)) { 27 22 // t_url2aが無効 28 if ( in_array($GLOBALS['_CMD']['type'], db_get_url2a_denied_list()) ){29 return $ url;23 if (in_array($GLOBALS['_CMD']['type'], db_get_url2a_denied_list())) { 24 return $matches[0]; 30 25 } else { 31 26 // t_url2aが有効 … … 38 33 <script type="text/javascript"> 39 34 <!-- 40 url2cmd('{$ url}');35 url2cmd('{$matches[0]}'); 41 36 //--> 42 37 </script> -
OpenPNE/branches/2.8.x/webapp/lib/util/util.php
r2651 r2734 439 439 $target = sprintf(' target="%s"', $target); 440 440 } 441 442 $url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); 443 $urlstr = htmlspecialchars($urlstr, ENT_QUOTES, 'UTF-8'); 444 441 445 return sprintf('<a href="%s"%s>%s</a>', $url, $target, $urlstr); 442 446 } -
OpenPNE/branches/2.8.x/webapp/modules/ktai/templates/c_bbs.tpl
r2664 r2734 15 15 <a href="({t_url m=ktai a=page_f_home})&target_c_member_id=({$c_commu_topic.c_member_id})&({$tail})">({$c_commu_topic.nickname|default:" "})</a> 16 16 <br> 17 ({$c_commu_topic.body| nl2br|default:" "})<br>17 ({$c_commu_topic.body|t_url2a_ktai|nl2br})<br> 18 18 ({if $c_commu_topic.image_filename1})画像:[<a href="({t_img_url filename=$c_commu_topic.image_filename1 w=120 h=120 f=jpg})">小</a>/<a href="({t_img_url filename=$c_commu_topic.image_filename1 f=jpg})">大</a>]<br>({/if}) 19 19 ({if $c_commu_topic.image_filename2})画像:[<a href="({t_img_url filename=$c_commu_topic.image_filename2 w=120 h=120 f=jpg})">小</a>/<a href="({t_img_url filename=$c_commu_topic.image_filename2 f=jpg})">大</a>]<br>({/if}) … … 46 46 ({/if}) 47 47 詳細:<br> 48 ({$c_commu_topic.body| nl2br|default:" "})<br>48 ({$c_commu_topic.body|t_url2a_ktai|nl2br})<br> 49 49 ({if $c_commu_topic.image_filename1})画像:[<a href="({t_img_url filename=$c_commu_topic.image_filename1 w=120 h=120 f=jpg})">小</a>/<a href="({t_img_url filename=$c_commu_topic.image_filename1 f=jpg})">大</a>]<br>({/if}) 50 50 ({if $c_commu_topic.image_filename2})画像:[<a href="({t_img_url filename=$c_commu_topic.image_filename2 w=120 h=120 f=jpg})">小</a>/<a href="({t_img_url filename=$c_commu_topic.image_filename2 f=jpg})">大</a>]<br>({/if}) … … 74 74 ({$item.number}).({if $item.nickname})<a href="({t_url m=ktai a=page_f_home})&target_c_member_id=({$item.c_member_id})&({$tail})">({$item.nickname})</a>({/if}) 75 75 <br> 76 ({$item.body| nl2br|default:" "})<br>76 ({$item.body|t_url2a_ktai|nl2br})<br> 77 77 ({if $item.image_filename1})画像:[<a href="({t_img_url filename=$item.image_filename1 w=120 h=120 f=jpg})">小</a>/<a href="({t_img_url filename=$item.image_filename1 f=jpg})">大</a>]<br>({/if}) 78 78 ({if $item.image_filename2})画像:[<a href="({t_img_url filename=$item.image_filename2 w=120 h=120 f=jpg})">小</a>/<a href="({t_img_url filename=$item.image_filename2 f=jpg})">大</a>]<br>({/if}) -
OpenPNE/branches/2.8.x/webapp/modules/ktai/templates/c_home.tpl
r2655 r2734 84 84 <a name="intro">説明文</a> 85 85 <br> 86 ({$c_commu.info| nl2br})<br>86 ({$c_commu.info|t_url2a_ktai|nl2br})<br> 87 87 ({if $c_commu.image_filename}) 88 88 コミュニティ画像:[<a href="({t_img_url filename=$c_commu.image_filename w=120 h=120 f=jpg})">小</a>/<a href="({t_img_url filename=$c_commu.image_filename f=jpg})">大</a>]<br>({/if}) -
OpenPNE/branches/2.8.x/webapp/modules/ktai/templates/f_home.tpl
r2524 r2734 155 155 ({if $item.form_type == 'textarea'}) 156 156 <font color="green">[({$item.caption})]</font><br> 157 ({$item.value| nl2br})157 ({$item.value|t_url2a_ktai|nl2br}) 158 158 <br> 159 159 ({/if}) -
OpenPNE/branches/2.8.x/webapp/modules/ktai/templates/fh_diary.tpl
r2180 r2734 50 50 [<a href="({t_url m=ktai a=page_fh_diary_delete_c_diary_comment_confirm})&target_c_diary_comment_id=({$c_diary_comment_.c_diary_comment_id})&({$tail})&target_c_diary_id=({$target_c_diary.c_diary_id})">削除</a>] 51 51 ({/if})<br> 52 ({$c_diary_comment_.body|t_url2a_ktai|nl2br |default:" "})<br>52 ({$c_diary_comment_.body|t_url2a_ktai|nl2br})<br> 53 53 <br> 54 54 ({if $c_diary_comment_.image_filename_1}) -
OpenPNE/branches/2.8.x/webapp/modules/ktai/templates/fh_intro.tpl
r2 r2734 5 5 ({foreach from=$intro_list item=item}) 6 6 <a href="({t_url m=ktai a=page_f_home})&target_c_member_id=({$item.c_member_id})&({$tail})">({$item.nickname})</a><br> 7 ({$item.intro| nl2br})<br>7 ({$item.intro|t_url2a_ktai|nl2br})<br> 8 8 9 9 ({if $target_member.c_member_id==$member.c_member_id}) -
OpenPNE/branches/2.8.x/webapp/modules/ktai/templates/h_message.tpl
r2292 r2734 22 22 ({$c_message.subject})<br> 23 23 <br> 24 ({$c_message.body| nl2br})24 ({$c_message.body|t_url2a_ktai|nl2br}) 25 25 <br> 26 26 <br> -
OpenPNE/branches/2.8.x/webapp_biz/modules/ktai/templates/f_home.tpl
r2524 r2734 157 157 ({if $item.form_type == 'textarea'}) 158 158 <font color="green">[({$item.caption})]</font><br> 159 ({$item.value| nl2br})159 ({$item.value|t_url2a_ktai|nl2br}) 160 160 <br> 161 161 ({/if})
Note: See TracChangeset
for help on using the changeset viewer.