Drupal 6.22 のインストールで奇妙な問題が発生しました。添付のスクリーンショット
インストール画面で、st() 関数で生成されたフォームにテキスト ラベル (#title 値) が表示されない。#type = 'textfield' の場合のみ生成されません。例: '#type' => 'fieldset' が機能しています。
<?php
$form['basic_options']['db_path'] = array(
'#type' => 'textfield',
'#title' => st('Database name'),
'#default_value' => $db_path,
'#size' => 45,
'#required' => TRUE,
'#description' => $db_path_description
);
?>
Linode VPS でホストされているサイト。Ubuntu、Apache2、PHP バージョン 5.3.5-1
mbstring が有効になっています。
更新 1:
関数 filter_xss が正しく機能していません。このフィルタがなければ、すべて正常に動作します!
function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {
// Only operate on valid UTF-8 strings. This is necessary to prevent cross
// site scripting issues on Internet Explorer 6.
if (!drupal_validate_utf8($string)) {
return '';
}
// Store the input format
_filter_xss_split($allowed_tags, TRUE);
// Remove NUL characters (ignored by some browsers)
$string = str_replace(chr(0), '', $string);
// Remove Netscape 4 JS entities
$string = preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string);
// Defuse all HTML entities
$string = str_replace('&', '&', $string);
// Change back only well-formed entities in our whitelist
// Decimal numeric entities
$string = preg_replace('/&#([0-9]+;)/', '&#\1', $string);
// Hexadecimal numeric entities
$string = preg_replace('/&#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\1', $string);
// Named entities
$string = preg_replace('/&([A-Za-z][A-Za-z0-9]*;)/', '&\1', $string);
return preg_replace_callback('%
(
<(?=[^a-zA-Z!/]) # a lone <
| # or
<!--.*?--> # a comment
| # or
<[^>]*(>|$) # a string that starts with a <, up until the > or the end of the string
| # or
> # just a >
)%x', '_filter_xss_split', $string);
}
更新 2:
関数 drupal_validate_utf8 の問題
function drupal_validate_utf8($text) {
if (strlen($text) == 0) {
return TRUE;
}
// For performance reasons this logic is duplicated in check_plain().
return (preg_match('/^./us', $text) == 1);
}
サーバーのエンコーディングがUTF-8であるため、奇妙です。どこで確認できますか?
ホスティングに関するその他の情報が必要な場合は、php_info - すぐに質問にお答えします。
ありがとうございました!!