You are here

function _quiz_is_empty_html in Quiz 7.4

Same name and namespace in other branches
  1. 8.4 quiz.module \_quiz_is_empty_html()
  2. 6.4 quiz.module \_quiz_is_empty_html()
  3. 7.6 quiz.module \_quiz_is_empty_html()
  4. 7 quiz.module \_quiz_is_empty_html()
  5. 7.5 quiz.module \_quiz_is_empty_html()

Helper function used when figuring out if a textfield or textarea is empty.

Solves a problem with some wysiwyg editors inserting spaces and tags without content.

Parameters

$html: The html to evaluate

Return value

TRUE if the field is empty(can still be tags there) false otherwise.

1 call to _quiz_is_empty_html()
quiz_validate in ./quiz.module
Implements hook_validate().

File

./quiz.module, line 4510
Quiz Module

Code

function _quiz_is_empty_html($html) {
  return drupal_strlen(trim(str_replace('&nbsp;', '', strip_tags($html, '<img><object><embed>')))) == 0;
}