我在安装 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 - 我会立即回答您的问题。
谢谢!!