[P2-php-svn] [761] expack:

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 3日 (日) 02:13:28 JST


Revision: 761
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=761
Author:   rsk
Date:     2010-01-03 02:13:28 +0900 (Sun, 03 Jan 2010)

Log Message:
-----------
expack:
- 公式p2を使った書き込みで、Cookie確認があった場合の処理を改善。
- 「BEで書き込む」機能が使えなくなっていたのを修正。
-- 自分のrep2と公式p2の両方にBEの設定がしてあれば、公式p2+BEで
   書き込むこともできる。この際、BEアカウントは公式p2に登録して
   いるものが使われる。
- GETリクエストによるRSSリストの編集ができなかったのを修正。

Modified Paths:
--------------
    p2ex/trunk/editrss.php
    p2ex/trunk/lib/P2Client.php
    p2ex/trunk/lib/P2Util.php
    p2ex/trunk/lib/ThreadRead.php
    p2ex/trunk/lib/expack/rss/common.inc.php
    p2ex/trunk/lib/expack/rss/parser.inc.php
    p2ex/trunk/lib/expack/rss/setrss.inc.php
    p2ex/trunk/lib/post_form.inc.php
    p2ex/trunk/read_rss.php
    p2ex/trunk/subject_rss.php


-------------- next part --------------
Modified: p2ex/trunk/editrss.php
===================================================================
--- p2ex/trunk/editrss.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/editrss.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -10,6 +10,7 @@
 
 // •Ï” =============
 $_info_msg_ht = '';
+$editrss_php_ht = htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES);
 
 //================================================================
 //“ÁŽê‚È‘O’uˆ—
@@ -25,7 +26,7 @@
 // RSS’ljÁƒtƒH[ƒ€
 $add_rss_form_ht = <<<EOFORM
 <hr>
-<form method="POST" action="{$_SERVER['SCRIPT_NAME']}" accept-charset="{$_conf['accept_charset']}" target="_self">
+<form method="POST" action="{$editrss_php_ht}" accept-charset="{$_conf['accept_charset']}" target="_self">
     <input type="hidden" id="setrss" name="setrss" value="1">
     <table border="0" cellspacing="1" cellpadding="0">
         <tr>
@@ -239,7 +240,7 @@
         $script_enable_html .= <<<EOP
 RSS‚Ì•À‚Ñ‘Ö‚¦iƒhƒ‰ƒbƒOƒAƒ“ƒhƒhƒƒbƒvj
 <div class="itas">
-<form id="form" name="form" method="post" action="{$_SERVER['SCRIPT_NAME']}" accept-charset="{$_conf['accept_charset']}" target="_self">
+<form id="form" name="form" method="post" action="{$editrss_php_ht}" accept-charset="{$_conf['accept_charset']}" target="_self">
 
 <table border="0">
 <tr>
@@ -299,6 +300,7 @@
         if (count($p) > 1) {
             $site = $p[0];
             $xml = $p[1];
+            $xml_en = rawurlencode($xml);
             if (isset($p[2]) && $p[2] == 1) {
                 $atom = 1;
                 $atom_ht = '&amp;atom=1';
@@ -310,18 +312,16 @@
                 $type_ht = 'RSS';
                 $cngtype_ht = '&amp;setrss=atom';
             }
-            $site_en = rawurlencode(base64_encode($site));
-            $site_ht = "&amp;site_en=".$site_en;
-            $xml_en = rawurlencode($xml);
+            $site_ht = '&amp;site_en=' . rawurlencode(base64_encode($site));
             echo <<<EOP
     <tr>
-        <td><a href="{$_SERVER['SCRIPT_NAME']}?xml={$xml_en}&amp;setrss=0" class="fav">š</a></td>
+        <td><a href="{$editrss_php_ht}?xml={$xml_en}&amp;setrss=0" class="fav">š</a></td>
         <td><a href="subject_rss.php?xml={$xml_en}{$site_ht}{$atom_ht}">{$site}</a></td>
-        <td>(<a class="te" href="{$_SERVER['SCRIPT_NAME']}?xml={$xml_en}{$site_ht}{$cngtype_ht}">{$type_ht}</a>)</td>
-        <td>[ <a class="te" href="{$_SERVER['SCRIPT_NAME']}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=top">£</a></td>
-        <td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=up">ª</a></td>
-        <td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=down">«</a></td>
-        <td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=bottom">¥</a> ]</td>
+        <td>(<a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$cngtype_ht}">{$type_ht}</a>)</td>
+        <td>[ <a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=top">£</a></td>
+        <td><a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=up">ª</a></td>
+        <td><a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=down">«</a></td>
+        <td><a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=bottom">¥</a> ]</td>
     </tr>\n
 EOP;
         }

Modified: p2ex/trunk/lib/P2Client.php
===================================================================
--- p2ex/trunk/lib/P2Client.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/lib/P2Client.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -45,8 +45,14 @@
     const REQUEST_PARAMETER_MESSAGE = 'MESSAGE';
     const REQUEST_PARAMETER_POPUP   = 'popup';
     const REQUEST_PARAMETER_BERES   = 'submit_beres';
+    const REQUEST_PARAMETER_CHARACTER_SET_DETECTION_HINT = 'detect_hint';
 
     /**
+     * HTTPƒŠƒNƒGƒXƒg‚̌Œèƒpƒ‰ƒ[ƒ^
+     */
+    const REQUEST_DATA_CHARACTER_SET_DETECTION_HINT = 'ž';
+
+    /**
      * “ǂݍž‚ݐ³”Û”»’è‚Ì‚½‚ß‚Ì•¶Žš—ñ
      */
     const NEEDLE_READ_NO_THREAD = '<b>p2 info - ”ƒT[ƒo‚©‚çÅV‚̃XƒŒƒbƒhî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</b>';
@@ -159,11 +165,13 @@
      * @param array $data
      * @param P2DOM $dom
      * @param DOMElement $form
-     * @return array HTTPƒŒƒXƒ|ƒ“ƒX
+     * @param mixed &$response
+     * @return bool
      * @throws P2Exception
      */
     public function login($uri = null, array $data = array(),
-                          P2DOM $dom = null, DOMElement $form = null)
+                          P2DOM $dom = null, DOMElement $form = null,
+                          &$response = null)
     {
         if ($uri === null) {
             $uri = self::P2_ROOT_URI;
@@ -172,6 +180,7 @@
         if ($dom === null) {
             $response = $this->httpGet($uri);
             $dom = new P2DOM($response['body']);
+            $form = null;
         }
 
         if ($form === null) {
@@ -189,7 +198,9 @@
         $postData[self::REQUEST_PARAMETER_LOGIN_ID] = rawurlencode($this->_loginId);
         $postData[self::REQUEST_PARAMETER_LOGIN_PASS] = rawurlencode($this->_loginPass);
 
-        return $this->httpPost($uri, $postData, true);
+        $response = $this->httpPost($uri, $postData, true);
+
+        return $this->getLoginForm(new P2DOM($response['body'])) === null;
     }
 
     // }}}
@@ -219,9 +230,7 @@
         $dom = new P2DOM($response['body']);
 
         if ($form = $this->getLoginForm($dom)) {
-            $response = $this->login($uri, $getData, $dom, $form);
-            $dom = new P2DOM($response['body']);
-            if ($this->getLoginForm($dom)) {
+            if (!$this->login($uri, $getData, $dom, $form, $response)) {
                 throw new P2Exception('Login failed.');
             }
         }
@@ -327,16 +336,18 @@
 
         // CookieŠm”FŒã‚ÌPOST‚Å‚Ì•¶Žš‰»‚¯—\–h‚Ì‚½‚ß
         // URLƒGƒ“ƒR[ƒhÏ‚Ý‚Ì’l‚ð—pˆÓ‚µ‚Ä‚¨‚¢‚čđã“ü‚·‚éB
+        $hintEncoded = rawurlencode(self::REQUEST_DATA_CHARACTER_SET_DETECTION_HINT);
         $nameEncoded = rawurlencode($name);
         $mailEncoded = rawurlencode($mail);
         $messageEncoded = rawurlencode($message);
 
         // POST‚·‚éƒf[ƒ^‚ð—pˆÓB
         $postData = $this->getFormValues($dom, $form);
-        $postData[self::REQUEST_PARAMETER_POPUP] = '1';
+        $postData[self::REQUEST_PARAMETER_CHARACTER_SET_DETECTION_HINT] = $hintEncoded;
         $postData[self::REQUEST_PARAMETER_NAME] = $nameEncoded;
         $postData[self::REQUEST_PARAMETER_MAIL] = $mailEncoded;
         $postData[self::REQUEST_PARAMETER_MESSAGE] = $messageEncoded;
+        $postData[self::REQUEST_PARAMETER_POPUP] = '1';
         if ($beRes) {
             $postData[self::REQUEST_PARAMETER_BERES] = '1';
         } elseif (array_key_exists(self::REQUEST_PARAMETER_BERES, $postData)) {
@@ -348,15 +359,21 @@
 
         // CookieŠm”F‚̏ꍇ‚͍ÄPOSTB
         if (preg_match(self::REGEX_POST_COOKIE, $response['body'])) {
-            $dom = new P2DOM($response['body']);
+            $html = str_replace('<META http-equiv="Content-Type" content="text/html; charset=x-sjis">',
+                                '<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">',
+                                $response['body']);
+            $dom = new P2DOM($html);
             $expression = './/form[contains(@action, "' . self::SCRIPT_NAME_POST . '")]';
             $result = $dom->query($expression);
             if ($result instanceof DOMNodeList && $result->length > 0) {
                 $postData = $this->getFormValues($dom, $result->item(0));
+                $postData[self::REQUEST_PARAMETER_CHARACTER_SET_DETECTION_HINT] = $hintEncoded;
                 $postData[self::REQUEST_PARAMETER_NAME] = $nameEncoded;
                 $postData[self::REQUEST_PARAMETER_MAIL] = $mailEncoded;
                 $postData[self::REQUEST_PARAMETER_MESSAGE] = $messageEncoded;
                 $response = $this->httpPost($uri, $postData, true);
+            } else {
+                return false;
             }
         }
 
@@ -381,8 +398,8 @@
     {
         $code = $this->_httpClient->get($uri, $data, $preEncoded, $headers);
         P2Exception::pearErrorToP2Exception($code);
-        if ($code < 200 || $code >= 300) {
-            throw new P2Exception('HTTP Error: '. $code);
+        if ($code != 200) {
+            throw new P2Exception('HTTP '. $code);
         }
         return $this->_httpClient->currentResponse();
     }
@@ -406,8 +423,8 @@
     {
         $code = $this->_httpClient->post($uri, $data, $preEncoded, $files, $headers);
         P2Exception::pearErrorToP2Exception($code);
-        if ($code < 200 || $code >= 300) {
-            throw new P2Exception('HTTP Error: '. $code);
+        if ($code != 200) {
+            throw new P2Exception('HTTP '. $code);
         }
         return $this->_httpClient->currentResponse();
     }

Modified: p2ex/trunk/lib/P2Util.php
===================================================================
--- p2ex/trunk/lib/P2Util.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/lib/P2Util.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -62,7 +62,7 @@
     /**
      *  ƒtƒ@ƒCƒ‹‚ðƒ_ƒEƒ“ƒ[ƒh•Û‘¶‚·‚é
      */
-    static public function fileDownload($url, $localfile, $disp_error = 1)
+    static public function fileDownload($url, $localfile, $disp_error = true)
     {
         global $_conf, $_info_msg_ht;
 
@@ -91,6 +91,12 @@
         if ($wap_res->isError() && $disp_error) {
             $url_t = self::throughIme($wap_req->url);
             $_info_msg_ht .= "<div>Error: {$wap_res->code} {$wap_res->message}<br>";
+            if ($wap_res->isRedirect() && array_key_exists('Location', $wap_res->headers)) {
+                $location = $wap_res->headers['Location'];
+                $location_ht = htmlspecialchars($location, ENT_QUOTES);
+                $location_t = P2Util::throughIme($location);
+                $_info_msg_ht .= "Location: <a href=\"{$location_t}\"{$_conf['ext_win_target_at']}>{$location_ht}</a><br>";
+            }
             $_info_msg_ht .= "p2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$wap_req->url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</div>";
         }
 

Modified: p2ex/trunk/lib/ThreadRead.php
===================================================================
--- p2ex/trunk/lib/ThreadRead.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/lib/ThreadRead.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -88,6 +88,9 @@
             } elseif (P2Util::isHost2chs($this->host) && !empty($_GET['moritapodat']) &&
                       $_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass'])
             {
+                if (!array_key_exists('csrfid', $_GET) || P2Util::getCsrfId() != $_GET['csrfid']) {
+                    p2die('•s³‚ȃŠƒNƒGƒXƒg‚Å‚·');
+                }
                 $this->_downloadDat2chMoritapo();
 
             // 2ch‚̉ߋŽƒƒO‘qŒÉ“Ç‚Ý
@@ -1352,7 +1355,12 @@
         global $_conf;
 
         if ($_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass']) {
-            return " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;moritapodat=true\">ƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+            $query = htmlspecialchars('host=' . rawurldecode($this->host)
+                                    . '&bbs=' . rawurldecode($this->bbs)
+                                    . '&key=' . rawurldecode($this->key)
+                                    . '&ls=' . rawurldecode($this->ls)
+                                    . '&moritapodat=true&csrfid=' . P2Util::getCsrfId(), ENT_QUOTES);
+            return " [<a href=\"{$_conf['read_php']}?{$query}\">ƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
         } else {
             return '';
         }
@@ -1440,6 +1448,8 @@
     {
         global $_conf;
 
+        $csrfid = P2Util::getCsrfId();
+
         $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
 
         if ($hosts = $this->scanOriginalHosts()) {
@@ -1461,6 +1471,7 @@
     <input type="hidden" name="ls" value="{$this->ls}">
     ‚É•Ï‚¦‚Ä
     <input type="submit" name="moritapodat" value="ƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚ñ‚Å‚Ý‚é">
+    <input type="hidden" name="csrfid" value="{$csrfid}">
     {$hosts_ht}
 </form>\n
 EOF;

Modified: p2ex/trunk/lib/expack/rss/common.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/common.inc.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/lib/expack/rss/common.inc.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -14,19 +14,19 @@
 function rss_get_save_path($remotefile)
 {
     global $_conf, $_info_msg_ht;
-    static $done = array();
+    static $finished = array();
 
     $remotefile = preg_replace('|^feed://|', 'http://', $remotefile);
 
-    if (isset($done[$remotefile])) {
-        return $done[$remotefile];
+    if (array_key_exists($remotefile, $finished)) {
+        return $finished[$remotefile];
     }
 
     $pURL = @parse_url($remotefile);
     if (!$pURL || !isset($pURL['scheme']) || $pURL['scheme'] != 'http' || !isset($pURL['host'])) {
         $errmsg = 'p2 error: •s³‚ÈRSS‚ÌURL (' . htmlspecialchars($remotefile, ENT_QUOTES) . ')';
-        $error = &PEAR::raiseError($errmsg);
-        return ($done[$remotefile] = $error);
+        $error = PEAR::raiseError($errmsg);
+        return ($finished[$remotefile] = $error);
     }
 
     $localname = '';
@@ -53,7 +53,7 @@
 
     $localpath = $_conf['dat_dir'] . '/p2_rss/' . $pURL['host'] . '/' . $localname;
 
-    return ($done[$remotefile] = $localpath);
+    return ($finished[$remotefile] = $localpath);
 }
 
 // }}}

Modified: p2ex/trunk/lib/expack/rss/parser.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/parser.inc.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/lib/expack/rss/parser.inc.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -3,6 +3,7 @@
  * rep2expack - RSS Parser
  */
 
+require_once P2_LIB_DIR . '/FileCtl.php';
 require_once P2EX_LIB_DIR . '/rss/common.inc.php';
 require_once 'XML/RSS.php';
 
@@ -12,9 +13,13 @@
     ((!$GLOBALS['_conf']['ktai'] && $GLOBALS['_conf']['expack.ic2.enabled'] % 2 == 1) ||
     ($GLOBALS['_conf']['ktai'] && $GLOBALS['_conf']['expack.ic2.enabled'] >= 2)))
 {
-    require_once P2EX_LIB_DIR . '/ic2/Switch.php';
+    if (!class_exists('IC2_Switch', false)) {
+        require P2EX_LIB_DIR . '/ic2/Switch.php';
+    }
     if (IC2_Switch::get($GLOBALS['_conf']['ktai'])) {
-        require_once P2EX_LIB_DIR . '/rss/getimage.inc.php';
+        if (!function_exists('rss_get_image')) {
+            require P2EX_LIB_DIR . '/rss/getimage.inc.php';
+        }
         define('P2_RSS_IMAGECACHE_AVAILABLE', 1);
     } else {
         define('P2_RSS_IMAGECACHE_AVAILABLE', 0);
@@ -43,7 +48,6 @@
 
     // •Û‘¶—pƒfƒBƒŒƒNƒgƒŠ‚ª‚È‚¯‚ê‚΂‚­‚é
     if (!is_dir(dirname($localpath))) {
-        require_once P2_LIB_DIR . '/FileCtl.php';
         FileCtl::mkdir_for($localpath);
     }
 
@@ -62,7 +66,7 @@
         if ($atom) {
             $atom = (isset($dl) && $dl->code == 200) ? 2 : 1;
         }
-        $rss = &p2ParseRSS($localpath, $atom);
+        $rss = p2ParseRSS($localpath, $atom);
         return $rss;
     } else {
         return $dl;
@@ -166,7 +170,6 @@
 
     // •Û‘¶—pƒfƒBƒŒƒNƒgƒŠ‚ª‚È‚¯‚ê‚΂‚­‚é
     if (!is_dir(dirname($output))) {
-        require_once P2_LIB_DIR . '/FileCtl.php';
         FileCtl::mkdir_for($output);
     }
 

Modified: p2ex/trunk/lib/expack/rss/setrss.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/setrss.inc.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/lib/expack/rss/setrss.inc.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -50,19 +50,14 @@
         unset($site, $xml, $atom, $m, $matches, $fp);
         return;
     }
-
-    $setrss  = isset($_POST['setrss'])  ? trim($_POST['setrss'])  : '';
-    $xml     = isset($_POST['xml'])     ? trim($_POST['xml'])     : '';
-    $site    = isset($_POST['site'])    ? trim($_POST['site'])    : '';
-    $site_en = isset($_POST['site_en']) ? trim($_POST['site_en']) : '';
-    $atom    = empty($_POST['atom']) ? 0 : 1;
-} else {
-    $setrss  = isset($_POST['setrss'])  ? trim($_GET['setrss'])  : '';
-    $xml     = isset($_POST['xml'])     ? trim($_GET['xml'])     : '';
-    $site    = isset($_POST['site'])    ? trim($_GET['site'])    : '';
-    $site_en = isset($_POST['site_en']) ? trim($_GET['site_en']) : '';
-    $atom    = empty($_GET['atom']) ? 0 : 1;
 }
+
+$setrss  = isset($_REQUEST['setrss'])  ? trim($_REQUEST['setrss'])  : '';
+$xml     = isset($_REQUEST['xml'])     ? trim($_REQUEST['xml'])     : '';
+$site    = isset($_REQUEST['site'])    ? trim($_REQUEST['site'])    : '';
+$site_en = isset($_REQUEST['site_en']) ? trim($_REQUEST['site_en']) : '';
+$atom    = empty($_REQUEST['atom'])    ? 0 : 1;
+
 // RSS‚̃^ƒCƒgƒ‹Ý’è
 if ($site === '') {
     if ($site_en !== '') {
@@ -72,6 +67,9 @@
     }
 }
 
+// feedƒXƒL[ƒ€‚ðhttpƒXƒL[ƒ€‚Å’uŠ·
+$xml = preg_replace('|^feed://|', 'http://', $xml);
+
 // ƒƒO‚É‹L˜^‚·‚é•Ï”‚ðÅ’áŒÀ‚̃Tƒjƒ^ƒCƒY
 $xml = preg_replace_callback('/\\s/', 'rawurlencode', $xml);
 $site = preg_replace('/\\s/', ' ', $site);

Modified: p2ex/trunk/lib/post_form.inc.php
===================================================================
--- p2ex/trunk/lib/post_form.inc.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/lib/post_form.inc.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -92,7 +92,7 @@
 {$htm['block_submit']}
 {$htm['table_break2']}
 <input id="kakiko_submit" type="submit" name="submit" value="{$submit_value}"{$htm['kaiko_set_hidden_js']}{$htm['submit_extra_at']}>
-{$htm['be2ch']}
+{$htm['beres']}
 {$htm['p2res']}
 {$htm['table_end']}
 

Modified: p2ex/trunk/read_rss.php
===================================================================
--- p2ex/trunk/read_rss.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/read_rss.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -6,6 +6,7 @@
 // {{{ p2Šî–{Ý’è“ǂݍž‚Ý&”FØ
 
 require_once './conf/conf.inc.php';
+require_once P2EX_LIB_DIR . '/rss/parser.inc.php';
 
 $_login->authorize();
 
@@ -40,7 +41,6 @@
 //============================================================
 
 if ($xml) {
-    require_once P2EX_LIB_DIR . '/rss/parser.inc.php';
     $rss = p2GetRSS($xml, $atom);
     if ($rss instanceof XML_Parser) {
         clearstatcache();

Modified: p2ex/trunk/subject_rss.php
===================================================================
--- p2ex/trunk/subject_rss.php	2010-01-02 07:46:50 UTC (rev 760)
+++ p2ex/trunk/subject_rss.php	2010-01-02 17:13:28 UTC (rev 761)
@@ -6,6 +6,7 @@
 // {{{ p2Šî–{Ý’è“ǂݍž‚Ý&”FØ
 
 require_once './conf/conf.inc.php';
+require_once P2EX_LIB_DIR . '/rss/parser.inc.php';
 
 $_login->authorize();
 
@@ -37,7 +38,6 @@
 //============================================================
 
 if ($xml) {
-    require_once P2EX_LIB_DIR . '/rss/parser.inc.php';
     $rss = p2GetRSS($xml, $atom);
     if ($rss instanceof XML_Parser) {
         clearstatcache();



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