[P2-php-svn] [923] p2/

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 9月 28日 (水) 00:53:37 JST


Revision: 923
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=923
Author:   akid
Date:     2011-09-28 00:53:37 +0900 (Wed, 28 Sep 2011)

Log Message:
-----------
p2/

- PHP設定 mbstring.func_overload 有効時の不具合を修正した。
Thanks → http://hibari.2ch.net/test/read.cgi/software/1306160232/515

- Windows Phone 7向けIE9での表示に少し対応した。
Thanks → http://hibari.2ch.net/test/read.cgi/software/1306160232/510

- Androidはyoutubeリンク変換の対象外とした。

- cookieのIP同一性チェックのデフォルトを変更。ログインフォームのチェックボックス「Cookie認証時にIPの同一性をチェックしない」を「Cookieログイン時、IPの同一性をチェックする」に変更した。
($_COOKIE['ignore_cip'] → $_COOKIE['check_cip'])

- gzip圧縮転送の設定を追加した。デフォルトでは携帯のみ有効。
(conf_admin.inc.php の $_conf['enable_ob_gzhandler'])

Modified Paths:
--------------
    p2/trunk/conf/conf.inc.php
    p2/trunk/conf/conf_admin.inc.php
    p2/trunk/iphone/ShowThreadK.php
    p2/trunk/iphone/js/respopup.iPhone.js
    p2/trunk/iphone/js/smartpopup.iPhone.js
    p2/trunk/iphone/read_header_k.inc.php
    p2/trunk/iui/iui.css
    p2/trunk/lib/BbsMap.php
    p2/trunk/lib/FileCtl.php
    p2/trunk/lib/Login.php
    p2/trunk/lib/P2Util.php
    p2/trunk/lib/SettingTxt.php
    p2/trunk/lib/ShowThreadPc.php
    p2/trunk/lib/SubjectTxt.php
    p2/trunk/lib/ThreadRead.php
    p2/trunk/lib/UA.php
    p2/trunk/lib/login_first.inc.php
    p2/trunk/read_new_i.php
    p2/trunk/title.php


-------------- next part --------------
Modified: p2/trunk/conf/conf.inc.php
===================================================================
--- p2/trunk/conf/conf.inc.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/conf/conf.inc.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -100,31 +100,9 @@
     $_conf['k_filter_marker'] = null;
 }
 
+_obStart();
 
-$_conf['output_callback'] = null;
 
-// ob_start('mb_output_handler');
-
-if (UA::isK() //&& $mobile && $mobile->isWillcom()
-    // gzip‰Â”\‚©‚Ç‚¤‚©‚ÍPHP‚Å”»•Ê‚µ‚Ä‚­‚ê‚é‚Í‚¸
-    //&& !ini_get('zlib.output_compression') // ƒT[ƒo[‚̐ݒè‚ÅŽ©“®gzipˆ³k‚ª—LŒø‚É‚È‚Á‚Ä‚¢‚È‚¢
-    //&& strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') // ƒuƒ‰ƒEƒU‚ªgzip‚ðƒfƒR[ƒh‚Å‚«‚é
-) {
-    !defined('SID') || !strlen(SID) and $_conf['output_callback'] = 'ob_gzhandler';
-}
-
-// gzipˆ³k‚·‚é‚Æ’€ŽŸo—Í‚Í‚Å‚«‚È‚³‚»‚¤
-//!defined('SID') || !strlen(SID) and $_conf['output_callback'] = 'ob_gzhandler';
-
-if ($_conf['output_callback']) {
-    ob_start($_conf['output_callback']);
-}
-
-// ob_gzhandler —˜—pŽžAƒoƒbƒtƒ@‚ª‚ ‚éó‘ԂŁAflush()‚µ‚Ä‚µ‚Ü‚¤‚Ægzip“]‘—‚É‚È‚ç‚È‚­‚È‚éB’¼‘O‚Éob_flush()‚ð“ü‚ê‚é‚ÆOKB
-//ob_flush();
-//print_r(ob_list_handlers());
-//print_r(getallheaders());
-
 //======================================================================
 // •Ï”Ý’è
 //======================================================================
@@ -291,7 +269,7 @@
 }
 
 /**
- * @return  void
+ * @return  void|die
  */
 function _prepareFileSession()
 {
@@ -322,6 +300,34 @@
     P2Util::session_gc();
 }
 
+/**
+ * @return  void
+ */
+function _obStart()
+{
+    global $_conf;
+    
+    // gzip‰Â”\‚©‚Ç‚¤‚©‚ÍPHP‚Å”»•Ê‚µ‚Ä‚­‚ê‚é‚Á‚Û‚¢‚¯‚Ç
+    if ($_conf['enable_ob_gzhandler']
+        && !ini_get('zlib.output_compression') // ƒT[ƒo[‚̐ݒè‚ÅŽ©“®gzipˆ³k‚ª—LŒø‚É‚È‚Á‚Ä‚¢‚È‚¢
+        && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') // ƒuƒ‰ƒEƒU‚ªgzip‚ðƒfƒR[ƒh‚Å‚«‚é
+    ) {
+        //if (!defined('SID') || !strlen(SID)) {
+            if ($_conf['enable_ob_gzhandler'] != 2 || UA::isK()) {
+                ob_start('ob_gzhandler');
+            }
+        //}
+    }
+
+
+    // ob_start('mb_output_handler');
+
+    // ob_gzhandler —˜—pŽžAƒoƒbƒtƒ@‚ª‚ ‚éó‘ԂŁAflush()‚µ‚Ä‚µ‚Ü‚¤‚Ægzip“]‘—‚É‚È‚ç‚È‚­‚È‚éB’¼‘O‚Éob_flush()‚ð“ü‚ê‚é‚ÆOKB
+    //ob_flush();
+    //print_r(ob_list_handlers());
+    //print_r(getallheaders());
+}
+
 /*
  * Local Variables:
  * mode: php

Modified: p2/trunk/conf/conf_admin.inc.php
===================================================================
--- p2/trunk/conf/conf_admin.inc.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/conf/conf_admin.inc.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -54,7 +54,8 @@
 // }}}
 // ----------------------------------------------------------------------
 
-// ƒZƒbƒVƒ‡ƒ“‚ðŽg‚¤ê‡‚́APHP‚̐ݒè‚Å session.use_trans_sid ‚ð—LŒø‚É‚·‚邱‚Ƃ𐄏§‚·‚é
+// ƒZƒbƒVƒ‡ƒ“‚ðŽg—p‚·‚éê‡‚́APHP‚̐ݒè‚Å session.use_trans_sid ‚ð—LŒø‚É‚·‚邱‚Ƃ𐄏§B
+// ¦$_conf['use_session']‚ð0‚É‚·‚é‚Ædocomo‚̌ŗL’[––”FØ‚ÍŽg‚¦‚È‚­‚È‚é‚Ì‚Å’ˆÓB
 $_conf['use_session'] = 2;          // (2) ƒZƒbƒVƒ‡ƒ“‚ð—˜—pi‚·‚é:1, ‚µ‚È‚¢:0, cookie”FØ‚ª—˜—p‚³‚ê‚Ä‚¢‚È‚¢Žž‚Ì‚Ý‚·‚é:2j
 
 $_conf['session_save'] = 'p2';      // ('p2') sessionƒf[ƒ^‚Ì•Û‘¶ŠÇ— (PHPƒfƒtƒHƒ‹ƒg:'', p2‚Ńtƒ@ƒCƒ‹ŠÇ—:'p2')
@@ -143,6 +144,7 @@
 
 // }}}
 
+$_conf['enable_ob_gzhandler'] = 2; // gzipˆ³k“]‘—‚ð—LŒø‚É‚·‚é‚©i¦—LŒø‚É‚·‚é‚Æ’€ŽŸ•\Ž¦‚ª‚Å‚«‚È‚­‚È‚éji‚·‚é:1, ‚µ‚È‚¢:0, Œg‘Ñ‚¾‚¯:2j
 
 /*
  * Local Variables:

Modified: p2/trunk/iphone/ShowThreadK.php
===================================================================
--- p2/trunk/iphone/ShowThreadK.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/iphone/ShowThreadK.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -250,7 +250,7 @@
             foreach ($quote_res_nums as $rnv) {
                 if (empty($this->quote_res_nums_done[$rnv]) and $rnv < count($this->thread->datlines)) {
                     $ds = $this->qRes($this->thread->datlines[$rnv-1], $rnv, 'q' . $rnv . 'of' . $this->thread->key);
-                    $onPopUp_at = " onMouseover=\"showResPopUp('q{$rnv}of{$this->thread->key}',event,true)\"";
+                    $onPopUp_at = " onmouseup=\"showResPopUp('q{$rnv}of{$this->thread->key}',event,true)\"";
                     $rpop .= "<span id=\"q{$rnv}of{$this->thread->key}\" class=\"respopup\"{$onPopUp_at}>" . $ds . "</span>\n";
                     $this->quote_res_nums_done[$rnv] = true;
                 }
@@ -325,10 +325,10 @@
         // iphone—p
         // ƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[iread_new’†‚Í–¢‘Ήž‚Æ‚·‚éj
         if ($_conf['enable_spm'] and empty($GLOBALS['_read_new_html'])) {
-            //$onPopUp_at = " onmouseover=\"showSPM({$this->thread->spmObjName},{$i},'{$id}',event,this)\" onmouseout=\"hideResPopUp('{$this->thread->spmObjName}_spm')\"";
+            //$onPopUp_at = " onmouseup=\"showSPM({$this->thread->spmObjName},{$i},'{$id}',event,this)\" onmouseout=\"hideResPopUp('{$this->thread->spmObjName}_spm')\"";
             // onmouseout="hideResPopUp()" ‚ÍŠO‚·•K—v‚ª‚ ‚é
             
-            $onPopUp_at = " onmouseover=\"showSPM({$this->thread->spmObjName},{$i},'{$id}',event,this)\"";
+            $onPopUp_at = " onmouseup=\"showSPM({$this->thread->spmObjName},{$i},'{$id}',event,this)\"";
             $is = "<a href=\"javascript:void(0);\" class=\"resnum\"{$onPopUp_at}>{$i}</a>";
         } else {
             $is = $i;
@@ -976,7 +976,7 @@
         $attributes = array();
         if ($_conf['quote_res_view']) {
             $attributes = array(
-                'onmouseover' => "showResPopUp('q{$qnum}of{$this->thread->key}',event)",
+                'onmouseup' => "showResPopUp('q{$qnum}of{$this->thread->key}',event)",
                 // d=1‚̓_ƒ~[B‚È‚º‚©return false‚¾‚¯‚¾‚ÆŒø‰Ê‚ª‚È‚¢‚悤‚̂ŁB
                 'onclick' => 'var dummy=1; return false;'
                 //'onmouseout'  => "hideResPopUp('q{$qnum}of{$this->thread->key}')"
@@ -1299,6 +1299,11 @@
     {
         global $_conf;
 
+        // Android‚Í youtube:ƒŠƒ“ƒN‚É”ñ‘Ήž
+        if (UA::isAndroidWebKit()) {
+            return false;
+        }
+        
         // http://www.youtube.com/watch?v=Mn8tiFnAUAI
         // http://m.youtube.com/watch?v=OhcX0xJsDK8&client=mv-google&gl=JP&hl=ja&guid=ON&warned=True
         if (preg_match('{^http://(www|jp|m)\\.youtube\\.com/watch\\?(?:.+&amp;)?v=([0-9a-zA-Z_\\-]+)}', $url, $m)) {

Modified: p2/trunk/iphone/js/respopup.iPhone.js
===================================================================
--- p2/trunk/iphone/js/respopup.iPhone.js	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/iphone/js/respopup.iPhone.js	2011-09-27 15:53:37 UTC (rev 923)
@@ -261,10 +261,10 @@
 /**
  * ƒŒƒXƒ|ƒbƒvƒAƒbƒv‚ð•\Ž¦ƒ^ƒCƒ}[‚·‚é
  *
- * ˆø—pƒŒƒX”Ô‚É onMouseover ‚ŌĂяo‚³‚ê‚é
+ * ˆø—pƒŒƒX”Ô‚É onmouseup ‚ŌĂяo‚³‚ê‚é
  * [memo] ‘æˆêˆø”‚ðeventƒIƒuƒWƒFƒNƒg‚É‚µ‚½•û‚ª‚æ‚¢‚¾‚낤‚©B
  *
- * @param  boolean  onPopSpace  ƒ|ƒbƒvƒAƒbƒvƒXƒy[ƒX‚Ö‚Ìonmouseover‚ł̌Ăяo‚µ‚È‚çBd•¡ŒÄ‚яo‚µ‰ñ”ð‚Ì‚½‚߁B
+ * @param  boolean  onPopSpace  ƒ|ƒbƒvƒAƒbƒvƒXƒy[ƒX‚Ö‚Ì onmouseup ‚ł̌Ăяo‚µ‚È‚çBd•¡ŒÄ‚яo‚µ‰ñ”ð‚Ì‚½‚߁B
  */
 function showResPopUp(popId, ev, onPopSpace)
 {

Modified: p2/trunk/iphone/js/smartpopup.iPhone.js
===================================================================
--- p2/trunk/iphone/js/smartpopup.iPhone.js	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/iphone/js/smartpopup.iPhone.js	2011-09-27 15:53:37 UTC (rev 923)
@@ -183,9 +183,9 @@
 		spmPopUpDelay = "delaySec=0;";
 	}
 	//ƒ[ƒ‹ƒI[ƒo[
-	var spmPopUpEvent  = " onmouseover=\"" + spmPopUpDelay + "showResPopUp('" + popup_id + "',event,true);\"";
+	var spmPopUpEvent  = " onmouseup=\"" + spmPopUpDelay + "showResPopUp('" + popup_id + "',event,true);\"";
 	//ƒ[ƒ‹ƒAƒEƒg
-		spmPopUpEvent += " onmouseout=\""  + spmPopUpDelay + "hideResPopUp('" + popup_id + "');\"";
+	//	spmPopUpEvent += " onmouseout=\""  + spmPopUpDelay + "hideResPopUp('" + popup_id + "');\"";
 	return spmPopUpEvent;
 }
 

Modified: p2/trunk/iphone/read_header_k.inc.php
===================================================================
--- p2/trunk/iphone/read_header_k.inc.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/iphone/read_header_k.inc.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -374,7 +374,7 @@
 // ƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[ JavaScriptƒR[ƒh
 if ($_conf['enable_spm']) {
     // smartpopup.iPhone.js needs post_form.js's popUpFootbarFormIPhone().
-    ?><script type="text/javascript" src="iphone/js/smartpopup.iPhone.js?v=20070308"></script><?php
+    ?><script type="text/javascript" src="iphone/js/smartpopup.iPhone.js?v=20110715"></script><?php
     
     $aThread->showSmartPopUpMenuJs();
 }

Modified: p2/trunk/iui/iui.css
===================================================================
--- p2/trunk/iui/iui.css	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/iui/iui.css	2011-09-27 15:53:37 UTC (rev 923)
@@ -47,7 +47,8 @@
 }
 */
 /* ƒc[ƒ‹ƒo[Aã‚Ì‚Æ‚± */
-body > .toolbar {
+/* body > .toolbar { */
+body .toolbar {
 	box-sizing: border-box;
 	-moz-box-sizing: border-box;
 	-webkit-box-sizing: border-box;
@@ -59,7 +60,8 @@
 }
 
 /* ƒc[ƒ‹ƒo[‚̐^‚ñ’†‚Ì•¶Žš */
-.toolbar > h1 {
+/* .toolbar > h1 { */
+.toolbar h1#pageTitle {
 	position: absolute;
 	overflow: hidden;
 	left: 50%;
@@ -75,7 +77,8 @@
 	color: #FFFFFF;
 }
 
-.toolbar > h1 > a {
+/* .toolbar > h1 > a { */
+.toolbar h1 a {
 	color:white;
 }
 
@@ -156,7 +159,8 @@
 ƒƒjƒ…[‚̈ꗗ‚âƒXƒŒˆê——‚È‚Ç
 •¶Žš‚Ì‘å‚«‚³“™‚Í‚±‚±‚Å
 */
-body > ul > li {
+/* body > ul > li { */
+body ul li {
 	position: relative;
 	margin: 0;
 	border-bottom: 1px solid #E0E0E0;
@@ -171,7 +175,8 @@
 ˆê——‚̃Oƒ‹[ƒv–¼
 top‚ł́uƒƒjƒ…[vu”ÂŒŸõv‚Æ•\Ž¦‚³‚ê‚Ä‚é‚Æ‚±‚ë
 */
-body > ul > li.group {
+/* body > ul > li.group { */
+body ul li.group {
 	position: relative;
 	/* top: -1px;
 	margin-bottom: -2px; */
@@ -185,7 +190,8 @@
 	color: #FFFFFF;
 }
 
-body > ul > li.group:first-child {
+/* body > ul > li.group:first-child { */
+body ul li.group:first-child {
 	top: 0;
 	border-top: none;
 }
@@ -279,7 +285,8 @@
 	margin-left: 0px;
 	padding: 0px;
 }
-form > ul > li.group {
+/* form > ul > li.group { */
+form ul li.group {
 	position: relative;
 	top: -1px;
 	margin-left: 0px;
@@ -295,7 +302,8 @@
 	color: #FFFFFF;
 }
 
-form > ul > li.group:first-child {
+/* form > ul > li.group:first-child { */
+form ul li.group:first-child {
 	top: 0;
 	border-top: none;
 }
@@ -364,7 +372,8 @@
 
 /************************************************************************************************/
 
-body > .panel {
+/* body > .panel { */
+body .panel {
 	box-sizing: border-box;
 	-webkit-box-sizing: border-box;
 	padding: 10px;
@@ -531,7 +540,8 @@
 	margin: 0;
 }
 
-.foot_sure>span {
+/* .foot_sure > span { */
+.foot_sure span {
 	width: 64px;
 	height: 50px;
 	overflow: hidden;

Modified: p2/trunk/lib/BbsMap.php
===================================================================
--- p2/trunk/lib/BbsMap.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/BbsMap.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -319,7 +319,9 @@
                 return $map;
             }
         } else {
-            FileCtl::mkdirFor($map_cache_path);
+            if (false === FileCtl::mkdirFor($map_cache_path)) {
+                return false;
+            }
         }
         touch($map_cache_path);
         clearstatcache();

Modified: p2/trunk/lib/FileCtl.php
===================================================================
--- p2/trunk/lib/FileCtl.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/FileCtl.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -78,6 +78,7 @@
     
     /**
      * mkdirR() ‚ÌŽÀˆ—‚ðs‚¤
+     * [todo] die‚Í‚µ‚½‚­‚È‚¢
      *
      * @access  private
      * @param   integer  $rtimes  Ä‹AŒÄ‚яo‚µ‚³‚ê‚Ä‚¢‚錻Ý‰ñ”
@@ -114,7 +115,7 @@
         }
         
         // e‚©‚çæ‚ɍċAŽÀs
-        if (!FileCtl::_mkdirR(dirname($dir), $perm, $die, ++$rtimes)) {
+        if (false === FileCtl::_mkdirR(dirname($dir), $perm, $die, ++$rtimes)) {
             $die and die('Error: FileCtl::_mkdirR()');
             return false;
         }
@@ -183,17 +184,54 @@
     function getGzFileContents($filepath)
     {
         if (is_readable($filepath)) {
+            /*
+            ob_implicit_flush(false);
             ob_start();
             readgzfile($filepath);
             $contents = ob_get_contents();
             ob_end_clean();
             return $contents;
+            */
+            return implode('', gzfile($filepath));
         }
         
         return false;
     }
-
+    
     /**
+     * ƒVƒXƒeƒ€ƒRƒ}ƒ“ƒh‚Ńtƒ@ƒCƒ‹‚Ìgzip‰ð“€‚ðs‚¤ihoge.txt.gz ¨ hoge.txtj
+     *
+     * @static
+     * @access  public
+     * @return  boolean
+     */
+    function ungzipWithSystemCommand($gzfile, $bakfile)
+    {
+        // ungzƒtƒ@ƒCƒ‹‚ªŠù‚É‘¶Ý‚·‚é‚È‚çˆêŽž“I‚ɃoƒbƒNƒAƒbƒv‚µ‚Ä‘Þ”ð
+        $ungzfile = rtrim($gzfile, '.gz');
+        if (file_exists($ungzfile)) {
+            file_exists($bakfile) and unlink($bakfile);
+            rename($ungzfile, $bakfile);
+        }
+        
+        // ‰ð“€‚·‚éihoge.txt.gz ‚ª hoge.txt ‚É•ÏŠ·‚³‚ê‚éj
+        $rcode = 1;
+        system(sprintf('gzip -d %s', escapeshellarg($gzfile)), $rcode);
+        
+        // ‰ð“€Ž¸”s‚È‚çƒoƒbƒNƒAƒbƒv‚ð–ß‚·
+        if ($rcode != 0) {
+            if (file_exists($bakfile)) {
+                file_exists($ungzfile) and unlink($ungzfile); // •ÏŠ·Ž¸”s‚µ‚½ƒtƒ@ƒCƒ‹‚ðíœ‚·‚é
+                rename($bakfile, $ungzfile);
+            }
+            return false;
+        }
+        // ‰ð“€¬Œ÷
+        file_exists($bakfile) and unlink($bakfile);
+        return true;
+    }
+    
+    /**
      * Windows‚ł͏㏑‚«‚Ì rename() ‚ŃGƒ‰[‚ªo‚é‚悤‚Ȃ̂ŁA‚»‚̃Gƒ‰[‚ð‰ñ”ð‚µ‚½rename()
      * ¦‚½‚¾‚µAunlink() ‚Æ rename() ‚̊Ԃňêu‚ÌŠÔ‚ª‹ó‚­‚Ì‚ÅŠ®‘S‚Å‚Í‚È‚¢B
      * ŽQl http://ns1.php.gr.jp/pipermail/php-users/2005-October/027827.html
@@ -213,53 +251,59 @@
         }
         return rename($src_file, $dest_file);
     }
-
+    
     /**
-     * ‘‚«ž‚Ý’†‚Ì•sŠ®‘S‚ȃtƒ@ƒCƒ‹“à—e‚ª“Ç‚ÝŽæ‚ç‚ê‚邱‚Æ‚Ì‚È‚¢‚悤‚ɁAˆêŽžƒtƒ@ƒCƒ‹‚ɏ‘‚«ž‚ñ‚Å‚©‚烊ƒl[ƒ€‚·‚é
-     * ¦‚½‚¾‚µAWindows‚̏ꍇ‚́Aã‘‚«rename‚ª•sŠ®‘S‚Æ‚È‚é‚Ì‚Å’¼Ú‘‚«ž‚Þ‚±‚Æ‚Æ‚·‚é
+     * ‘‚«ž‚Ý’†‚Ì•sŠ®‘S‚ȃtƒ@ƒCƒ‹“à—e‚ª“Ç‚ÝŽæ‚ç‚ê‚邱‚Æ‚Ì‚È‚¢‚悤‚ɁAˆêŽžƒtƒ@ƒCƒ‹‚ɏ‘‚«ž‚ñ‚Å‚©‚烊ƒl[ƒ€‚·‚éB
+     * ¦‚½‚¾‚µAWindows‚̏ꍇ‚́Aã‘‚«rename‚ª•sŠ®‘S‚Æ‚È‚é‚Ì‚Å’¼Ú‘‚«ž‚Þ‚±‚Æ‚Æ‚·‚éB
+     * $tmp_path‚ňꎞƒtƒ@ƒCƒ‹ƒpƒX‚ðŽw’肵‚È‚¢ê‡A“¯Žž‚ɏ‘‚«ž‚Ý‚ª‚ ‚é‚Æ‹L˜^‚̏‡˜‚͕ۏ؂³‚ê‚È‚¢B
      *
      * @static
      * @access  public
-     * @param   string   $tmp_dir  ˆêŽž•Û‘¶ƒfƒBƒŒƒNƒgƒŠ
-     * @return  boolean  ŽÀs¬”Û i¬Œ÷Žž‚ɏ‘‚«ž‚݃oƒCƒg”‚ð•Ô‚·ˆÓ–¡‚Á‚Ä‚Ù‚Æ‚ñ‚Ç‚È‚¢‹C‚ª‚·‚éj
+     * @param   string   $tmp_dir   ˆêŽž•Û‘¶ƒfƒBƒŒƒNƒgƒŠ‚ÌŽw’èB
+     * @param   string   $tmp_path  iƒfƒBƒŒƒNƒgƒŠ‚ðŠÜ‚ß‚½jˆêŽž•Û‘¶ƒtƒ@ƒCƒ‹ƒpƒX‚Ì–¾Ž¦Žw’èB‚±‚ê‚ðŽw’肵‚½ê‡A$tmp_dir ‚Í–³Œø‚Æ‚È‚éB
+     * @return  boolean  ŽÀs¬”Û  i¬Œ÷Žž‚ɏ‘‚«ž‚݃oƒCƒg”‚ð•Ô‚·ˆÓ–¡‚Í‚Ù‚Æ‚ñ‚Ç‚È‚¢‚ÆŽv‚¤j
      */
-    function filePutRename($file, $cont, $tmp_dir = null)
+    function filePutRename($file, $cont, $tmp_dir = null, $tmp_path = null)
     {
-        if (strlen($file) == 0) {
+        if (!strlen($file)) {
             trigger_error(__CLASS__ . '::' . __FUNCTION__ . '(), file is null', E_USER_WARNING);
             return false;
         }
         
         $win = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
         
-        // ˆêŽžƒtƒ@ƒCƒ‹ƒpƒX‚ðŒˆ‚ß‚é
-        $prefix = 'rename_';
         
-        // ˆêŽžƒfƒBƒŒƒNƒgƒŠ‚Ì–¾Ž¦Žw’肪‚ ‚éê‡
-        if ($tmp_dir) { // strlen($tmp_dir) > 0 ‚Æ‚·‚ׂ«‚Æ‚±‚낾‚ªA‚Þ‚µ‚ë"0"‚à‚È‚µ‚Æ‚¢‚¤‚±‚Æ‚É‚µ‚Ä‚Ý‚é
-            if (!is_dir($tmp_dir)) {
-                trigger_error(__FUNCTION__ . "() -> is_dir($tmp_dir) failed.", E_USER_WARNING);
-                return false;
-            }
-        
+        if (strlen($tmp_path)) {
+            $write_file = $win ? $file : $tmp_path;
+            
         } else {
-            if (isset($GLOBALS['_conf']['tmp_dir'])) {
-                $tmp_dir = $GLOBALS['_conf']['tmp_dir'];
+            // ˆêŽžƒfƒBƒŒƒNƒgƒŠ‚Ì–¾Ž¦Žw’肪‚ ‚éê‡
+            if (strlen($tmp_dir)) {
                 if (!is_dir($tmp_dir)) {
-                    FileCtl::mkdirR($tmp_dir);
+                    trigger_error(__FUNCTION__ . "() -> is_dir($tmp_dir) failed.", E_USER_WARNING);
+                    return false;
                 }
             } else {
-                // 2006/10/05 php_get_tmpdir() ‚Í might be only in CVS
-                if (function_exists('php_get_tmpdir')) {
-                    $tmp_dir = php_get_tmpdir();
+                if (isset($GLOBALS['_conf']['tmp_dir'])) {
+                    $tmp_dir = $GLOBALS['_conf']['tmp_dir'];
+                    if (!is_dir($tmp_dir)) {
+                        if (false === FileCtl::mkdirR($tmp_dir)) {
+                            return false;
+                        }
+                    }
                 } else {
-                    // ‚±‚ê‚Å“®ì‚Í‚·‚邪AnullŽw’è‚Å‚à‘åä•v‚©‚ȁB2007/01/22 Win‚Å‚ÍNG?–¢Šm”F
+                    // 2006/10/05 php_get_tmpdir() ‚Í might be only in CVS
+                    // $tmp_dir = php_get_tmpdir();
+
+                    // null‚Å‚à''‚Å‚àAtempnam()‚ŃVƒXƒeƒ€‚̃eƒ“ƒ|ƒ‰ƒŠƒfƒBƒŒƒNƒgƒŠ‚ªŽg—p‚³‚ê‚邪A‚±‚ê‚Å‚¢‚¢‚à‚Ì‚©B
+                    // 2007/01/22 Win‚Å‚ÍNG?–¢Šm”F
                     $tmp_dir = null;
                 }
             }
+
+            // tempnam()‚ō쐬‚µ‚½ƒtƒ@ƒCƒ‹‚̃p[ƒ~ƒbƒVƒ‡ƒ“‚Í0600‚É‚È‚é
+            $write_file = $win ? $file : tempnam($tmp_dir, $prefix = 'rename_');
         }
-
-        $write_file = $win ? $file : tempnam($tmp_dir, $prefix);
         
         if (false === $r = file_put_contents($write_file, $cont, LOCK_EX)) {
             return false;

Modified: p2/trunk/lib/Login.php
===================================================================
--- p2/trunk/lib/Login.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/Login.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -754,11 +754,11 @@
         if (!empty($_REQUEST['ctl_regist_cookie'])) {
             if ($_REQUEST['regist_cookie'] == '1') {
             
-                $ignore_cip = false;
-                if (!empty($_POST['ignore_cip'])) {
-                    $ignore_cip = true;
+                $check_cip = false;
+                if (!empty($_POST['check_cip'])) {
+                    $check_cip = true;
                 }
-                $r = $this->setCookieCid($this->user_u, $this->pass_x, $ignore_cip);
+                $r = $this->setCookieCid($this->user_u, $this->pass_x, $check_cip);
             } else {
                 // ƒNƒbƒL[‚ðƒNƒŠƒA
                 $r = $this->clearCookieAuth();
@@ -777,7 +777,7 @@
      {
         $r = P2Util::unsetCookie('cid');
 
-        $_COOKIE = array();
+        //$_COOKIE = array();
         
         return $r;
     }
@@ -788,21 +788,21 @@
      * @access  protected
      * @return  boolean
      */
-    function setCookieCid($user_u, $pass_x, $ignore_cip = null)
+    function setCookieCid($user_u, $pass_x, $check_cip = null)
     {
         global $_conf;
         
         $time = time() + 60*60*24 * $_conf['cid_expire_day'];
         
-        if (!is_null($ignore_cip)) {
-            if ($ignore_cip) {
-                P2Util::setCookie('ignore_cip', '1', time() + 60*60*24*365); // ‚±‚±‚ÍŠúŒÀ‚ª’·‚­‚Ä‚à\‚í‚È‚¢
-                $_COOKIE['ignore_cip'] = '1';
-            } else {
-                P2Util::unsetCookie('ignore_cip');
-                // ”O‚Ì‚½‚߃hƒƒCƒ“Žw’è‚È‚µ‚à
-                setcookie('ignore_cip', '', time() - 3600);
-            }
+        if (!is_null($check_cip)) {
+            //if ($check_cip) {
+                P2Util::setCookie('check_cip', (int)$check_cip, time() + 60*60*24*365); // ‚±‚±‚ÍŠúŒÀ‚ª’·‚­‚Ä‚à\‚í‚È‚¢
+                $_COOKIE['check_cip'] = (int)$check_cip;
+            //} else {
+            //    P2Util::unsetCookie('check_cip');
+            //    // ”O‚Ì‚½‚߃hƒƒCƒ“Žw’è‚È‚µ‚à
+            //    setcookie('check_cip', '', time() - 3600);
+            //}
         }
         
         if ($cid = $this->makeCid($user_u, $pass_x)) {
@@ -953,9 +953,7 @@
             || HostCheck::isAddrIbis()
         ) {
             ;
-        } elseif (!empty($_COOKIE['ignore_cip'])) {
-            ;
-        } else {
+        } elseif (!empty($_COOKIE['check_cip'])) {
             $now_ips = explode('.', $_SERVER['REMOTE_ADDR']);
             $seed .= $now_ips[0];
         }

Modified: p2/trunk/lib/P2Util.php
===================================================================
--- p2/trunk/lib/P2Util.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/P2Util.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -390,7 +390,20 @@
             }
         }
         
-        if (is_array($cArray) or setcookie("$key", '', time() - 3600, $path, $domain)) {
+        // 2011/07/16 softbank 821SC‚ÅŒŸØ
+        // setcookie()‚Å’l‚ð''‚ɃZƒbƒg‚Å‚«‚È‚¢B–³Ž‹‚³‚ê‚éB
+        // ŠúŒÀ‚ð‰ß‹Ž time()-1 ‚ŃZƒbƒg‚Å‚«‚È‚¢A–³Ž‹‚³‚ê‚éBtime() ‚Å‚©‚낤‚¶‚ÄOK‚¾‚Á‚½B
+        // ƒOƒO‚Á‚Ä‚Ý‚½‚ª“¯—l‚̐º‚Í‚È‚©‚Á‚½B‚±‚Ì‹@Ží(821SC)‚¾‚¯H‰½‚©“ÁŽê‚ȃP[ƒXH
+        
+        if (UA::isSoftBank()) {
+            $replace = $_COOKIE[$key];
+            $timelimit = time();
+        } else {
+            $replace = '';
+            $timelimit = time() - 3600;
+        }
+        
+        if (is_array($cArray) or setcookie("$key", $replace, $timelimit, $path, $domain)) {
             if ($cakey) {
                 eval("unset(\$_COOKIE{$cakey});");
             } else {
@@ -830,7 +843,7 @@
         
             if ($use_tmp_file) {
                 if (!is_dir($_conf['tmp_dir'])) {
-                    if (!FileCtl::mkdirR($_conf['tmp_dir'])) {
+                    if (false === FileCtl::mkdirR($_conf['tmp_dir'])) {
                         die("Error: $me, cannot mkdir.");
                         return false;
                     }

Modified: p2/trunk/lib/SettingTxt.php
===================================================================
--- p2/trunk/lib/SettingTxt.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/SettingTxt.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -78,7 +78,9 @@
 
         $perm = $_conf['dl_perm'] ? $_conf['dl_perm'] : 0606;
 
-        FileCtl::mkdirFor($this->setting_txt); // ”ƒfƒBƒŒƒNƒgƒŠ‚ª–³‚¯‚ê‚΍ì‚é
+        if (false === FileCtl::mkdirFor($this->setting_txt)) {
+            return false;
+        }
         
         $modified = null;
         if (file_exists($this->setting_srd) && file_exists($this->setting_txt)) {

Modified: p2/trunk/lib/ShowThreadPc.php
===================================================================
--- p2/trunk/lib/ShowThreadPc.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/ShowThreadPc.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -364,7 +364,7 @@
 
         $qpop_ht = '';
         $dummy_msg = '';
-        $quote_res_nums = $this->checkQuoteResNums(0, '1', $dummy_msg);
+        $quote_res_nums = $this->checkQuoteResNums(1, '1', $dummy_msg);
         foreach ($quote_res_nums as $rnv) {
             if (empty($this->quote_res_nums_done[$rnv])) {
                 $q_ht = '';

Modified: p2/trunk/lib/SubjectTxt.php
===================================================================
--- p2/trunk/lib/SubjectTxt.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/SubjectTxt.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -110,8 +110,9 @@
         $modified = false;
         
         if ($this->storage == 'file') {
-            FileCtl::mkdirFor($this->subject_file); // ”ƒfƒBƒŒƒNƒgƒŠ‚ª–³‚¯‚ê‚΍ì‚é
-
+            if (false === FileCtl::mkdirFor($this->subject_file)) {
+                return false;
+            }
             if (file_exists($this->subject_file)) {
             
                 // ƒtƒ@ƒCƒ‹ƒLƒƒƒbƒVƒ…‚ª‚ ‚ê‚΁ADL§ŒÀŽžŠÔ‚ð‚©‚¯‚é

Modified: p2/trunk/lib/ThreadRead.php
===================================================================
--- p2/trunk/lib/ThreadRead.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/ThreadRead.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -427,7 +427,8 @@
             flock($fp, LOCK_EX);
             if (0 === fseek($fp, $from_bytes)) {
                 if (false !== fwrite($fp, $body)) {
-                    ftruncate($fp, $from_bytes + strlen($body));
+                    // mbstring.func_overload‚ðl—¶‚µ‚āAstrlen($body) ‚Å‚Í‚È‚­A(strlen(bin2hex($body)) / 2) ‚Æ‚µ‚Ä‚¢‚éB
+                    ftruncate($fp, $from_bytes + (strlen(bin2hex($body)) / 2));
                     $done = true;
                 }
             }
@@ -587,14 +588,14 @@
         $code = $h['code'];
         
         // Partial Content
-        if ($code == "200") {
+        if ($code == '200') {
             // OKB‰½‚à‚µ‚È‚¢
         
         // Found
-        } elseif ($code == "304") {
+        } elseif ($code == '304') {
             fclose($fp);
             //$this->isonline = true;
-            return "304 Not Modified";
+            return '304 Not Modified';
             
         // —\Šú‚µ‚È‚¢HTTPƒR[ƒhB‚È‚©‚Á‚½‚Æ”»’f‚·‚é
         } else {
@@ -633,57 +634,39 @@
         }
         fclose($fp);
         
-        $done_gunzip = false;
+        $made_keydat = false;
         
         // gzipˆ³k‚È‚ç
         if ($isGzip) {
-            // gzip tempƒtƒ@ƒCƒ‹‚É•Û‘¶
-            $gztempfile = $this->keydat . '.gz';
-            FileCtl::mkdirFor($gztempfile);
-            if (file_put_contents($gztempfile, $body, LOCK_EX) === false) {
+            // ˆêŽžƒtƒ@ƒCƒ‹(dat.gz)‚É•Û‘¶
+            $keydatgzfile = $this->keydat . '.gz';
+            if (false === FileCtl::mkdirFor($keydatgzfile)) {
+                return false;
+            }
+            if (false === file_put_contents($keydatgzfile, $body, LOCK_EX)) {
                 die("Error: cannot write file. downloadDat2chMaru()");
                 return false;
             }
             
             // PHP‚ʼn𓀓ǂݍž‚Ý
             if (extension_loaded('zlib')) {
-                $body = FileCtl::getGzFileContents($gztempfile);
-            // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“‚ʼnð“€
+                $body = FileCtl::getGzFileContents($keydatgzfile);
+                
+            // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“gzip‚ʼn𓀕ۑ¶
             } else {
-                // Šù‚É‘¶Ý‚·‚é‚È‚çˆêŽždat‚ðƒoƒbƒNƒAƒbƒv‘Þ”ð
-                $keydat_bak = $this->keydat . '.bak';
-                if (file_exists($this->keydat)) {
-                    if (file_exists($keydat_bak)) {
-                        unlink($keydat_bak);
-                    }
-                    rename($this->keydat, $keydat_bak);
-                }
-                $rcode = 1;
-                // ‰ð“€‚·‚é
-                system("gzip -d $gztempfile", $rcode);
-                // ‰ð“€Ž¸”s‚È‚çƒoƒbƒNƒAƒbƒv‚ð–ß‚·
-                if ($rcode != 0) {
-                    if (file_exists($keydat_bak)) {
-                        file_exists($this->keydat) and unlink($this->keydat);
-                        rename($keydat_bak, $this->keydat);
-                    }
+                if (!FileCtl::ungzipWithSystemCommand($keydatgzfile, $this->keydat . '.bak')) {
+                    // Ž¸”s‚È‚ç
+                    // ˆêŽžƒtƒ@ƒCƒ‹(dat.gz)‚ðŽÌ‚Ä‚é
+                    file_exists($keydatgzfile) and unlink($keydatgzfile);
                     $this->pushDownloadDatErrorMsgHtml("<p>p2 info - 2‚¿‚á‚ñ‚Ë‚é‰ß‹ŽƒƒO‘qŒÉ‚©‚ç‚̃XƒŒƒbƒhŽæ‚荞‚݂́APHP‚Ì<a href=\"http://www.php.net/manual/ja/ref.zlib.php\">zlibŠg’£ƒ‚ƒWƒ…[ƒ‹</a>‚ª‚È‚¢‚©Asystem‚ÅgzipƒRƒ}ƒ“ƒh‚ªŽg—p‰Â”\‚Å‚È‚¯‚ê‚΂ł«‚Ü‚¹‚ñB</p>");
-                    // gztempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
-                    file_exists($gztempfile) and unlink($gztempfile);
-                    
                     $this->diedat = true;
                     return false;
-                    
-                // ‰ð“€¬Œ÷‚È‚ç
-                } else {
-                    file_exists($keydat_bak) and unlink($keydat_bak);
-                    
-                    $done_gunzip = true;
                 }
-
+                $made_keydat = true;
+                $body = file_get_contents($this->keydat);
             }
-            // gzip tempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
-            file_exists($gztempfile) and unlink($gztempfile);
+            // ˆêŽžƒtƒ@ƒCƒ‹(dat.gz)‚ðŽÌ‚Ä‚é
+            file_exists($keydatgzfile) and unlink($keydatgzfile);
         }
         
         /*
@@ -699,9 +682,9 @@
             return $this->downloadDat2chKako($kakolog, '.dat');
         }
 
-        if (!$done_gunzip) {
+        if (!$made_keydat) {
             FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
-            if (file_put_contents($this->keydat, $body, LOCK_EX) === false) {
+            if (false === file_put_contents($this->keydat, $body, LOCK_EX)) {
                 die("Error: cannot write file. downloadDat2chMaru()");
                 return false;
             }
@@ -726,7 +709,7 @@
                 }
             }
             FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
-            if (file_put_contents($this->keydat, $cont, LOCK_EX) === false) {
+            if (false === file_put_contents($this->keydat, $cont, LOCK_EX)) {
                 die("Error: cannot write file. downloadDat2chMaru()");
                 return false;
             }
@@ -849,14 +832,14 @@
         $code = $h['code'];
         
         // Partial Content
-        if ($code == "200") {
+        if ($code == '200') {
             // OKB‰½‚à‚µ‚È‚¢
         
         // Not Modified
-        } elseif ($code == "304") {
+        } elseif ($code == '304') {
             fclose($fp);
             //$this->isonline = true;
-            return "304 Not Modified";
+            return '304 Not Modified';
         
         // —\Šú‚µ‚È‚¢HTTPƒR[ƒhB‚È‚©‚Á‚½‚Æ”»’f
         } else {
@@ -890,56 +873,42 @@
         }
         fclose($fp);
         
-        $done_gunzip = false;
+        $made_keydat = false;
         
+        // gzipˆ³k‚È‚ç
         if ($isGzip) {
-            $gztempfile = $this->keydat . '.gz';
-            FileCtl::mkdirFor($gztempfile);
-            if (file_put_contents($gztempfile, $body, LOCK_EX) === false) {
+            // ˆêŽžƒtƒ@ƒCƒ‹(dat.gz)‚É•Û‘¶
+            $keydatgzfile = $this->keydat . '.gz';
+            if (false === FileCtl::mkdirFor($keydatgzfile)) {
+                return false;
+            }
+            if (file_put_contents($keydatgzfile, $body, LOCK_EX) === false) {
                 die("Error: cannot write file. downloadDat2chKako()");
                 return false;
             }
+            
+            // PHP‚ʼn𓀓ǂݍž‚Ý
             if (extension_loaded('zlib')) {
-                $body = FileCtl::getGzFileContents($gztempfile);
+                $body = FileCtl::getGzFileContents($keydatgzfile);
+                
+            // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“gzip‚ʼn𓀕ۑ¶
             } else {
-                // Šù‚É‘¶Ý‚·‚é‚È‚çˆêŽžƒoƒbƒNƒAƒbƒv‘Þ”ð
-                $keydat_bak = $this->keydat . '.bak';
-                if (file_exists($this->keydat)) {
-                    if (file_exists($keydat_bak)) {
-                        unlink($keydat_bak);
-                    }
-                    rename($this->keydat, $keydat_bak);
-                }
-                $rcode = 1;
-                // ‰ð“€
-                system("gzip -d $gztempfile", $rcode);
-                if ($rcode != 0) {
-                    if (file_exists($keydat_bak)) {
-                        if (file_exists($this->keydat)) {
-                            unlink($this->keydat);
-                        }
-                        // Ž¸”s‚È‚çƒoƒbƒNƒAƒbƒv–ß‚·
-                        rename($keydat_bak, $this->keydat);
-                    }
+                if (!FileCtl::ungzipWithSystemCommand($keydatgzfile, $this->keydat . '.bak')) {
+                    // Ž¸”s‚È‚ç
+                    // ˆêŽžƒtƒ@ƒCƒ‹(dat.gz)‚ðŽÌ‚Ä‚é
+                    file_exists($keydatgzfile) and unlink($keydatgzfile);
                     $this->pushDownloadDatErrorMsgHtml("<p>p2 info - 2‚¿‚á‚ñ‚Ë‚é‰ß‹ŽƒƒO‘qŒÉ‚©‚ç‚̃XƒŒƒbƒhŽæ‚荞‚݂́APHP‚Ì<a href=\"http://www.php.net/manual/ja/ref.zlib.php\">zlibŠg’£ƒ‚ƒWƒ…[ƒ‹</a>‚ª‚È‚¢‚©Asystem‚ÅgzipƒRƒ}ƒ“ƒh‚ªŽg—p‰Â”\‚Å‚È‚¯‚ê‚΂ł«‚Ü‚¹‚ñB</p>");
-                    // gztempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
-                    file_exists($gztempfile) and unlink($gztempfile);
                     $this->diedat = true;
                     return false;
-                    
-                } else {
-                    if (file_exists($keydat_bak)) {
-                        unlink($keydat_bak);
-                    }
-                    $done_gunzip = true;
                 }
-
+                $made_keydat = true;
+                //$body = file_get_contents($this->keydat);
             }
-            // tempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
-            file_exists($gztempfile) and unlink($gztempfile);
+            // ˆêŽžƒtƒ@ƒCƒ‹(dat.gz)‚ðŽÌ‚Ä‚é
+            file_exists($keydatgzfile) and unlink($keydatgzfile);
         }
 
-        if (!$done_gunzip) {
+        if (!$made_keydat) {
             FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
             if (false === file_put_contents($this->keydat, $body, LOCK_EX)) {
                 die("Error: cannot write file. downloadDat2chKako()");

Modified: p2/trunk/lib/UA.php
===================================================================
--- p2/trunk/lib/UA.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/UA.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -420,6 +420,22 @@
     }
     
     /**
+     * UA‚ªisSoftBank‚È‚çtrue‚ð•Ô‚·
+     *
+     * @static
+     * @access  public
+     * @param   string   $ua  UA‚ðŽw’è‚·‚é‚È‚ç
+     * @return  boolean
+     */
+    function isSoftBank($ua = null)
+    {
+        if ($nuam = &UA::getNet_UserAgent_Mobile($ua)) {
+            return $nuam->isSoftBank();
+        }
+        return false;
+    }
+    
+    /**
      * UA‚ªNetFrontiŒg‘сAPDAAPSPj‚È‚çtrue‚ð•Ô‚·
      *
      * @static

Modified: p2/trunk/lib/login_first.inc.php
===================================================================
--- p2/trunk/lib/login_first.inc.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/lib/login_first.inc.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -303,19 +303,21 @@
                 $regist_cookie_checked = '';
             }
         }
-        $ignore_cip_checked = '';
+        
+        $check_cip_checked = '';
         if (isset($_POST['submit_newuser']) || isset($_POST['submit_userlogin'])) {
-            if (geti($_POST['ignore_cip']) == '1') {
-                $ignore_cip_checked = ' checked';
+            if (!empty($_POST['check_cip'])) {
+                $check_cip_checked = ' checked';
             }
         } else {
-            if (geti($_COOKIE['ignore_cip']) == '1') {
-                $ignore_cip_checked = ' checked';
+            if (array_key_exists('check_cip', $_COOKIE) && $_COOKIE['check_cip']) {
+                $check_cip_checked = ' checked';
             }
         }
+        
         $auth_sub_input_ht = '<input type="hidden" name="ctl_regist_cookie" value="1">'
-          . sprintf('<input type="checkbox" id="regist_cookie" name="regist_cookie" value="1"%s><label for="regist_cookie">ƒƒOƒCƒ“î•ñ‚ðCookie‚É•Û‘¶‚·‚éi„§j</label><br>', $regist_cookie_checked)
-          . sprintf('<input type="checkbox" id="ignore_cip" name="ignore_cip" value="1"%s><label for="ignore_cip">Cookie”FØŽž‚ÉIP‚Ì“¯ˆê«‚ðƒ`ƒFƒbƒN‚µ‚È‚¢</label><br>', $ignore_cip_checked);
+          . sprintf('<input type="checkbox" id="regist_cookie" name="regist_cookie" value="1"%s><label for="regist_cookie">ƒƒOƒCƒ“î•ñ‚ðCookie‚É•Û‘¶‚·‚é</label><br>', $regist_cookie_checked)
+          . sprintf('<input type="checkbox" id="check_cip" name="check_cip" value="1"%s><label for="check_cip">CookieƒƒOƒCƒ“ŽžAIP‚Ì“¯ˆê«‚ðƒ`ƒFƒbƒN‚·‚éi‚æ‚èˆÀ‘Sj</label><br>', $check_cip_checked);
     }
     
     return $auth_sub_input_ht;

Modified: p2/trunk/read_new_i.php
===================================================================
--- p2/trunk/read_new_i.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/read_new_i.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -164,7 +164,7 @@
 	<script type="text/javascript" src="iphone/js/setfavjs.js?v=20090428"></script>
 	<script type="text/javascript" src="js/post_form.js?v=20090724"></script>
 	<?php // smartpopup.iPhone.js needs post_form.js's popUpFootbarFormIPhone(). ?>
-	<script type="text/javascript" src="iphone/js/smartpopup.iPhone.js?v=20090724"></script>
+	<script type="text/javascript" src="iphone/js/smartpopup.iPhone.js?v=20110715"></script>
 	<script type="text/javascript"> 
 	<!-- 
 		gExistWord = false;

Modified: p2/trunk/title.php
===================================================================
--- p2/trunk/title.php	2011-09-25 16:23:46 UTC (rev 922)
+++ p2/trunk/title.php	2011-09-27 15:53:37 UTC (rev 923)
@@ -149,7 +149,7 @@
 /**
  * ƒIƒ“ƒ‰ƒCƒ“ã‚Ìrep2ÅV”Å‚ðƒ`ƒFƒbƒN‚·‚é
  *
- * @return  string  HTML
+ * @return  string|false  HTML
  */
 function _checkUpdatan()
 {
@@ -159,7 +159,9 @@
     
     $ver_txt_url = $_conf['p2web_url'] . 'p2status.txt';
     $cachefile = P2Util::cacheFileForDL($ver_txt_url);
-    FileCtl::mkdirFor($cachefile);
+    if (false === FileCtl::mkdirFor($cachefile)) {
+        return false;
+    }
     
     if (file_exists($cachefile)) {
         // ƒLƒƒƒbƒVƒ…‚̍XV‚ªŽw’莞ŠÔˆÈ“à‚È‚ç



P2-php-svn メーリングリストの案内
Back to archive index