application/msword docといったエントリがあるんだが、file コマンドの判定結果が、application/msword にしかならないから、拡張子が".doc"じゃないとエラーになる。そのため、タイトルのエラーメッセージが出る。 では、どうすればいいかというと、とりあえずでよければ以下3つのどれか。
application/vnd.ms-excel xls
application/vnd.ms-powerpoint ppt
application/msword doc xls pptLocalSettings.php に以下を追加。
$wgMimeDetectorCommand = "file --brief --mime";もしくは
$wgMimeDetectorCommand = "file -bi";
$ pecl install fileinfoLocalSettings.php に以下を追加。
$wgLoadFileinfoExtension = true;
--- testwiki.orig/includes/specials/SpecialUpload.php 2008-12-23 16:32:33.000000000 -0800[MediaWikiのインストールディレクトリ]/includes/MimeMagic.php を編集(以下、patch)
+++ testwiki/includes/specials/SpecialUpload.php 2008-12-23 16:35:26.000000000 -0800
@@ -1324,7 +1324,7 @@
function verify( $tmpfile, $extension ) {
#magically determine mime type
$magic = MimeMagic::singleton();
- $mime = $magic->guessMimeType($tmpfile,false);
+ $mime = $magic->guessMimeType($tmpfile, $extension);
#check mime type, if desired
global $wgVerifyMimeType;
--- testwiki.orig/includes/MimeMagic.php 2008-12-23 16:32:08.000000000 -0800
+++ testwiki/includes/MimeMagic.php 2008-12-23 16:30:19.000000000 -0800
@@ -589,6 +589,16 @@
$m = trim( $m );
$m = strtolower( $m );
+ if ($m === 'application/msword') {
+ if ($ext === 'xls') {
+ $m = 'applicatoin/vnd.ms-excel';
+ wfDebug( __METHOD__. ": mime type has been changed to $m because the extension is $ext.\n");
+ } elseif ($ext === 'ppt') {
+ $m = 'applicatoin/vnd.ms-powerpoint';
+ wfDebug( __METHOD__. ": mime type has been changed to $m because the extension is $ext.\n");
+ }
+ }
+
if ( strpos( $m, 'unknown' ) !== false ) {
$m = NULL;
} else {
Hello!<br><a href="http://aixypeo.com/ayrxsa/1.html">buy cialis</a> ,
Hello!<br><a href="http://apxoiey.com/qoxvrt/1.html">cialis</a> ,
http://www.stlouisbusinesslist.com/business/5021837.htm?info=viagra viagra 袤
http://www.stlouisbusinesslist.com/business/5021837.htm?info=viagra buy viagra
WmoBYbyk
weLbMHFY http://roanqq.com/ <a href="http://ahftdl.com/ ">YgFMdtP</a> [url=http://uknqdb.com/]YgFMdtP[/url]