rep2 expack (rep2ex) でしたらばが読めない件
2013年12月10日にしたらばがドメインを変更し、livedoor.com から shitaraba.com にURLが変わっています。
これを受けて各所のしたらば対応2chブラウザがアップデートされる中 本家rep2でも迅速な修正が行われ、 すぐにまた読めるようになりました。
一方でその派生のrep2 expackは 2013年4月から更新が停滞 しているため、最新の開発版を導入してもしたらばが読めなくなっています。
ということで今回はこれを応急手当で修正する手順をメモ。
P2Util.phpの修正
手を加えるファイルはこれ1つだけです。
rep2を設置したディレクトリから見てlib/P2Util.php
にあります。
--- P2Util.old.php 2013-03-31 23:45:11 +0900&lf;+++ P2Util.php 2014-03-13 01:04:48 +0900&lf;@@ -928,7 +928,7 @@&lf; if (!array_key_exists($in_host, self::$_hostIsJbbsShitaraba)) {&lf; if ($in_host == 'rentalbbs.livedoor.com') {&lf; self::$_hostIsJbbsShitaraba[$in_host] = true;&lf;- } elseif (preg_match('<^jbbs\\.(?:shitaraba\\.com|livedoor\\.(?:com|jp))(?:/|$)>', $in_host)) {&lf;+ } elseif (preg_match('<^jbbs\\.(?:shitaraba\\.(?:com|net)|livedoor\\.(?:com|jp))(?:/|$)>', $in_host)) {&lf; self::$_hostIsJbbsShitaraba[$in_host] = true;&lf; } else {&lf; self::$_hostIsJbbsShitaraba[$in_host] = false;&lf;@@ -948,8 +948,9 @@&lf; */&lf; static public function adjustHostJbbs($in_str)&lf; {&lf;- return preg_replace('<(^|/)jbbs\\.(?:shitaraba|livedoor)\\.com(/|$)>', '\\1jbbs.livedoor.jp\\2', $in_str, 1);&lf;+ //return preg_replace('<(^|/)jbbs\\.(?:shitaraba|livedoor)\\.com(/|$)>', '\\1jbbs.livedoor.jp\\2', $in_str, 1);&lf; //return preg_replace('<(^|/)jbbs\\.(?:shitaraba\\.com|livedoor\\.(?:com|jp))(/|$)>', '\\1rentalbbs.livedoor.com\\2', $in_str, 1);&lf;+ return preg_replace('<(^|/)jbbs\\.(?:shitaraba\\.com|livedoor\\.(?:com|jp))(/|$)>', '\\1jbbs.shitaraba.net\\2', $in_str, 1);&lf; }&lf; &lf; // }}}&lf;@@ -1879,7 +1880,7 @@&lf; $ls = (isset($matches[4]) && strlen($matches[4])) ? $matches[4] : '';&lf; &lf; // したらばJBBS - http://jbbs.livedoor.com/bbs/read.cgi/computer/2999/1081177036/-100&lf;- } elseif (preg_match('<^http://(jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.com))/bbs/read\\.cgi&lf;+ } elseif (preg_match('<^http://(jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.(?:com|net)))/bbs/read\\.cgi&lf; /(\\w+)/(\\d+)/(\\d+)/((?:\\d+)?-(?:\\d+)?)?[^"]*>x', $nama_url, $matches))&lf; {&lf; $host = $matches[1] . '/' . $matches[2];&lf;@@ -1894,7 +1895,7 @@&lf; $host = $matches[1];&lf; list($bbs, $key, $ls) = self::parseMachiQuery($matches[2]);&lf; &lf;- } elseif (preg_match('<^http://((jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.com))(?:/(\\w+))?)/bbs/read\\.(?:pl|cgi)\\?(.+)>',&lf;+ } elseif (preg_match('<^http://((jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.(?:com|net)))(?:/(\\w+))?)/bbs/read\\.(?:pl|cgi)\\?(.+)>',&lf; $nama_url, $matches))&lf; {&lf; $host = $matches[1];&lf;
保存してしたらばのスレッドが読めるかチェックしましょう。
修正が面倒くさいとき
2chの有志 により修正済み差分がupされています。