Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1280
diff -u -p -r1.1280 node.module
--- modules/node/node.module	16 Jul 2010 02:37:06 -0000	1.1280
+++ modules/node/node.module	23 Jul 2010 12:30:58 -0000
@@ -929,6 +929,11 @@ function node_validate($node, $form = ar
     form_set_error('changed', t('The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved.'));
   }
 
+  // Verify that the title is not empty (contains more than whitespace).
+  if ($type->has_title && drupal_string_empty($node->title)) {
+    form_set_error('title', t('The title field cannot be only spaces or other whitespace.'));
+  }
+
   // Validate the "authored by" field.
   if (!empty($node->name) && !($account = user_load_by_name($node->name))) {
     // The use of empty() is mandatory in the context of usernames
@@ -948,6 +953,31 @@ function node_validate($node, $form = ar
 }
 
 /**
+ * Returns whether a value is non-empty (disregarding whitespace).
+ *
+ * @param $string
+ *   The string value to check.
+ * @param $trim_charlist
+ *   (optional) A string containing characters to strip from the beginning and
+ *   end of $string.
+ *
+ * @return
+ *   Boolean whether $string is empty, after removal of whitespace.
+ */
+function drupal_string_empty($string, $trim_charlist = ' \t\n\r\0\x0B') {
+  // If $string is not a string, it's never empty.
+  if (!is_string($string)) {
+    return FALSE;
+  }
+  // Remove leading and trailing whitespace and do a type-agnostic comparison
+  // with an empty string.
+  if (trim($string, $trim_charlist) === '') {
+    return TRUE;
+  }
+  return FALSE;
+}
+
+/**
  * Prepare node for saving by populating author and creation date.
  */
 function node_submit($node) {
