svnno****@sourc*****
svnno****@sourc*****
2010年 2月 23日 (火) 23:38:56 JST
Revision: 835 http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=835 Author: rsk Date: 2010-02-23 23:38:56 +0900 (Tue, 23 Feb 2010) Log Message: ----------- expack: - IE,Firefoxã§ã¯ã¹ã¬ä¸è¦§è¡¨ç¤ºã§ã¹ã¬ããã¿ã¤ãã«ã®ä¸ä¸ãåãããã¨ãããã®ã«å¯¾å¦ã - ãªãã¼ã¹ãããã·çµç±ã§ã®ã¢ã¯ã»ã¹ã«å¯¾å¿ããããã®è¨å®å¤ $_conf['reverse_proxy_{host,port,path}'] ã conf/conf_admin.inc.php ã«è¿½å ã Modified Paths: -------------- p2ex/trunk/conf/conf_admin.inc.php p2ex/trunk/conf/ip_au.php p2ex/trunk/lib/bootstrap.php p2ex/trunk/lib/startup.funcs.php p2ex/trunk/style/subject_css.inc p2ex/trunk/title.php -------------- next part -------------- Modified: p2ex/trunk/conf/conf_admin.inc.php =================================================================== --- p2ex/trunk/conf/conf_admin.inc.php 2010-02-16 11:45:37 UTC (rev 834) +++ p2ex/trunk/conf/conf_admin.inc.php 2010-02-23 14:38:56 UTC (rev 835) @@ -32,6 +32,31 @@ // }}} // ---------------------------------------------------------------------- +// {{{ o[XvLV + +// o[XvLVðʵÄANZX·éÛÌzXg¼B +// $_SERVER['HTTP_HOST'] ð㫵AIWiÌlð +// $_SERVER['X_REP2_ORIG_HTTP_HOST'] É«ÞB +// 'auto' ÌêA$_SERVER['HTTP_X_FORWARDED_HOST'] ª +// Ýè³êÄ¢é꾯Kp³êé +$_conf['reverse_proxy_host'] = ''; // ("") + +// o[XvLVðʵÄANZX·éÛÌ|[gÔB +// $_SERVER['HTTP_PORT'] ð㵫AIWiÌlð +// $_SERVER['X_REP2_ORIG_HTTP_PORT'] É«ÞB +// 'auto' ÌêA$_SERVER['HTTP_X_FORWARDED_PORT'] ª +// Ýè³êÄ¢é꾯Kp³êéB +$_conf['reverse_proxy_port'] = ''; // ("") + +// o[XvLVðʵÄANZX·éÛÌpXB +// $_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME'], $_SERVER['PHP_SELF'] +// ÌOÉtÁ³êéB +// IWiÌlÍA»ê¼ê $_SERVER["X_REP2_ORIG_{$key}"] É«ÜêéB +// reverse_proxy_host ª³øÌƫͳ³êéB +$_conf['reverse_proxy_path'] = ''; // ("") + +// }}} +// ---------------------------------------------------------------------- // {{{ ZL eB@\ /** Modified: p2ex/trunk/conf/ip_au.php =================================================================== --- p2ex/trunk/conf/ip_au.php 2010-02-16 11:45:37 UTC (rev 834) +++ p2ex/trunk/conf/ip_au.php 2010-02-23 14:38:56 UTC (rev 835) @@ -43,4 +43,5 @@ * c-basic-offset: 4 * indent-tabs-mode: nil * End: - */// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: Modified: p2ex/trunk/lib/bootstrap.php =================================================================== --- p2ex/trunk/lib/bootstrap.php 2010-02-16 11:45:37 UTC (rev 834) +++ p2ex/trunk/lib/bootstrap.php 2010-02-23 14:38:56 UTC (rev 835) @@ -6,6 +6,8 @@ require_once 'Net/UserAgent/Mobile.php'; +p2_rewrite_vars_for_proxy(); + // {{{ [U[Ýè Ç // [U[Ýèª êÎÇÝÞ Modified: p2ex/trunk/lib/startup.funcs.php =================================================================== --- p2ex/trunk/lib/startup.funcs.php 2010-02-16 11:45:37 UTC (rev 834) +++ p2ex/trunk/lib/startup.funcs.php 2010-02-23 14:38:56 UTC (rev 835) @@ -145,7 +145,7 @@ /** * NX[_[ * - * @string $name + * @param string $name * @return void */ function p2_load_class($name) @@ -191,7 +191,59 @@ } // }}} +// {{{ p2_rewrite_vars_for_proxy() +/** + * o[XvLVoRÅ®ì·éæ¤É$_SERVERÏð«·¦é + * + * @param void + * @return void + */ +function p2_rewrite_vars_for_proxy() +{ + global $_conf; + + foreach (array('HTTP_HOST', 'HTTP_PORT', 'REQUEST_URI', 'SCRIPT_NAME', 'PHP_SELF') as $key) { + $_SERVER["X_REP2_ORIG_{$key}"] = $_SERVER[$key]; + } + + if ($_conf['reverse_proxy_host']) { + if ($_conf['reverse_proxy_host'] === 'auto') { + if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { + $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; + } else { + return; + } + } else { + $_SERVER['HTTP_HOST'] = $_conf['reverse_proxy_host']; + } + } else { + return; + } + + if ($_conf['reverse_proxy_port']) { + if ($_conf['reverse_proxy_port'] === 'auto') { + if (isset($_SERVER['HTTP_X_FORWARDED_PORT'])) { + $SERVER['HTTP_PORT'] = $_SERVER['HTTP_X_FORWARDED_PORT']; + } + } else { + $SERVER['HTTP_PORT'] = $_conf['reverse_proxy_port']; + } + } + + if ($_conf['reverse_proxy_path']) { + foreach (array('REQUEST_URI', 'SCRIPT_NAME', 'PHP_SELF') as $key) { + if (!isset($_SERVER[$key]) || $_SERVER[$key] === '') { + $_SERVER[$key] = $_conf['reverse_proxy_path'] . '/'; + } else { + $_SERVER[$key] = $_conf['reverse_proxy_path'] . $_SERVER[$key]; + } + } + } +} + +// }}} + /* * Local Variables: * mode: php Modified: p2ex/trunk/style/subject_css.inc =================================================================== --- p2ex/trunk/style/subject_css.inc 2010-02-16 11:45:37 UTC (rev 834) +++ p2ex/trunk/style/subject_css.inc 2010-02-23 14:38:56 UTC (rev 835) @@ -16,7 +16,7 @@ echo <<<EOSTYLE -body{ +body { margin: 0 0 8px 0; padding: 0; line-height: 130%; @@ -36,8 +36,10 @@ margin: 0; padding: 0; } +/* form.check { } +*/ form#urlform { margin: 8px; } @@ -271,10 +273,13 @@ */ /* tl XbhXg ^Cg¼ */ +table.threadlist td.tl { + padding: 0 4px; +} table.threadlist td.tl div.el { min-width: 10em; margin: 0; - padding: 0; + padding: 4px 0; overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; Modified: p2ex/trunk/title.php =================================================================== --- p2ex/trunk/title.php 2010-02-16 11:45:37 UTC (rev 834) +++ p2ex/trunk/title.php 2010-02-23 14:38:56 UTC (rev 835) @@ -62,7 +62,7 @@ $htm['auth_user'] = "<p>OC[U: {$_login->user_u} - " . date("Y/m/d (D) G:i") . "</p>\n"; // igÑjOCpURL -$base_url = rtrim(dirname(P2Util::getMyUrl()), '/'); +$base_url = rtrim(dirname(P2Util::getMyUrl()), '/') . '/'; $url_b = $base_url . '?user=' . rawurlencode($_login->user_u) . '&b='; $url_b_ht = htmlspecialchars($url_b, ENT_QUOTES);