想知道是否有人可以帮助这个。这是我第一次看到这个错误。php pregmatch - 编译失败
警告:的preg_match()[function.preg匹配]:编译 失败:在没有任何偏移9
这是inrelation到我的这部分代码重复:
(isset($_POST[$post_key]) && $misc[2] === true && ! preg_match($misc[0], $_POST[$post_key]))
和我的完整(有点相关)一段代码如下。
发送过来的数据如下:
ajax-request true
author 1
epi 2
jbid 781711001327010590
message dfdf
type send-invite
任何人都知道任何原因或什么原因造成的错误?
case 'send-invite' :
if(free_member_is_logged_in()) {
$post_array = array(
'message' => array(
'#^.*{3,500}$#is',
'<p class="error_message">Please enter a message between 3 and 500 characters.</p>',
true
),
'epi' => array(
'#^[0-9]+$#is',
'<p class="error_message">An internal error has occured. If this problem persists please contact support</p>',
true
),
'author' => array(
'#^[0-9]+$#is',
'<p class="error_message">An internal error has occured. If this problem persists please contact support.</p>',
true
),
'jbid' => array(
'#^[0-9]+$#is',
'<p class="error_message">Please specify a job which you have published.</p>',
true
)
);
$continue = true;
foreach($post_array as $post_key => $misc) {
if(
(! isset($_POST[$post_key]) && $misc[2] === true)
||
(isset($_POST[$post_key]) && $misc[2] === true && ! preg_match($misc[0], $_POST[$post_key]))
||
(isset($_POST[$post_key]) && $misc[2] === false && $_POST[$post_key] != '' && ! preg_match($misc[0], $_POST[$post_key]))
) {
$continue = false;
$error_message = $misc[1];
}
${cleankey($post_key)} = res($_POST[$post_key]);
}
即时消息一个白痴,欢呼,只是删除了asterix。 – 2012-01-28 06:31:20