Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
fixed check for textarea fields (allow raw)
Browse files Browse the repository at this point in the history
  • Loading branch information
webbird committed Apr 11, 2012
1 parent 68a8ea1 commit ab3dfa6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion class.wbFormBuilder.php
Expand Up @@ -521,9 +521,11 @@ public function checkForm( $formname = '' ) {
if ( isset( $element['allow'] ) ) { if ( isset( $element['allow'] ) ) {
$allow = $element['allow']; $allow = $element['allow'];
} }
$this->log()->LogDebug( 'allow: '.$allow );


// check captcha // check captcha
if ( $element['type'] == 'captcha' ) { if ( $element['type'] == 'captcha' ) {
$this->log()->LogDebug( 'checking captcha' );
if ( ! class_exists('wbFormBuilderCaptcha',false) ) { if ( ! class_exists('wbFormBuilderCaptcha',false) ) {
include dirname(__FILE__).'/wbFormBuilder/class.wbFormBuilderCaptcha.php'; include dirname(__FILE__).'/wbFormBuilder/class.wbFormBuilderCaptcha.php';


Expand All @@ -548,7 +550,8 @@ public function checkForm( $formname = '' ) {
// makes the check for required field fail. // makes the check for required field fail.
if ( $element['type'] == 'textarea' ) { if ( $element['type'] == 'textarea' ) {
if ( isset($element['editor']) && $element['editor'] == true ) { if ( isset($element['editor']) && $element['editor'] == true ) {
$value = $this->val->param( $element['name'] ); $value = $this->val->param( $element['name'], 'PCRE_PLAIN' );
// br only means there's no content
if ( preg_match( '/^<br>$/i', $value ) ) { if ( preg_match( '/^<br>$/i', $value ) ) {
$this->val->delete( $element['name'] ); $this->val->delete( $element['name'] );
} }
Expand Down

0 comments on commit ab3dfa6

Please sign in to comment.