phpCollabのバグ
オープンソースPMSのphpCollabを試しにインストールいたら、インストーラーのStep2で何度も引っかかり先に進めません。
inlcudes/settings.php
を開いてみると、
# database parameters
define('MYSERVER','serveraddress');
define('MYLOGIN','xxxxx');
define('MYPASSWORD','*******');
define('MYDATABASE','collab');
と出ていて、ログイン名はxx-xxxでハイフンが無くなってました。どうやら正規表現で除外されてる模様。
※あとDBのprefixに”_”は自動で付きません
例に漏れずGoogleに聞いてみたら、こちらも見つかりました。
PANIC! Error during connection on server MySQL. [message #3757]
http://www.php-collab.com/community/index.php?t=msg&goto=8638&S=a823c8b0e22b376a85a2bd768351e8f5
やり方は、general/data_funcs.inc.phpを開き、
<?php
/**
* Data functions that will be used through the app
* These functions are global and shoudl be safer
* @author David Bates (norman77@users.sourceforge.net) ($Author: norman77 $)
* @since 05-Nov-2008
* @version $Revision: 1.3 $
*/
/**
* Scrubs data .. makes it safe for writting into settings.php or database
* @return array $returnData Scrubbed Data
* @param array $data Data from Post or GET (key - val paris)
*/
function scrubData($data) {
$regEx = "/[^a-zA-Z0-9 .@:\/_-]*/"; // Used to remove characters, if they aren't in this list, they will be removed
$retData = array();
foreach ($data as $key => $val) {
$dVal = preg_replace($regEx, '', $val);
$retData[$key] = $dVal;
}
return $retData;
}
?>
の16行目の、
$regEx = "/[^a-zA-Z0-9 .@:\/_]*/";
を、
$regEx = "/[^a-zA-Z0-9 .@:\/_-]*/";
に変えればハイフン付きのDBアカウント、DB名に対応します。
Google先生、本当にありがとう。

phpCollabのバグ | Surely You’re Joking, Mr.KUTAI! http://bit.ly/h4hJ6e