Some more rewrites and fix for countPostSelection()
[mailer.git] / inc / wrapper-functions.php
index bc7e7714636bc0c6131ca21d9e8e5bc244fe8fe5..cd1eddf236e914c1e55ca1d592837e7b78aa9081 100644 (file)
@@ -428,8 +428,15 @@ function removeFile ($FQFN) {
 }
 
 // Wrapper for $_POST['sel']
-function countPostSelection () {
-       return countSelection(postRequestElement('sel'));
+function countPostSelection ($element = 'sel') {
+       // Is it set?
+       if (isPostRequestElementSet($element)) {
+               // Return counted elements
+               return countSelection(postRequestElement($element));
+       } else {
+               // Return zero if not found
+               return 0;
+       }
 }
 
 // Checks wether the config-local.php is loaded