function _quiz_is_empty_html in Quiz 7.5
Same name and namespace in other branches
- 8.4 quiz.module \_quiz_is_empty_html()
- 6.4 quiz.module \_quiz_is_empty_html()
- 7.6 quiz.module \_quiz_is_empty_html()
- 7 quiz.module \_quiz_is_empty_html()
- 7.4 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
bool 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 3349 - quiz.module Main file for the Quiz module.
Code
function _quiz_is_empty_html($html) {
return drupal_strlen(trim(str_replace(' ', '', strip_tags($html, '<img><object><embed>')))) == 0;
}