was wondering if someone could help with this one. This is the first time I've seen this error.
Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 9
which is inrelation to this part of my code:
( isset( $_POST[$post_key] ) && $misc[2] === true && ! preg_match( $misc[0], $_POST[$post_key] ) )
and my full (bit thats relevant) piece of code is below.
The data sent over is as follows:
ajax-request true
author 1
epi 2
jbid 781711001327010590
message dfdf
type send-invite
Anyone know any reason for this or what causes the error?
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]);
}