diff --git a/includes/theme.inc b/includes/theme.inc
index ff54d6e..bd92b68 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -2596,9 +2596,10 @@ function template_preprocess_html(&$variables) {
   }
 
   // Construct page title.
-  if (drupal_get_title()) {
+  $title = drupal_get_title();
+  if (isset($title)) {
     $head_title = array(
-      'title' => strip_tags(drupal_get_title()),
+      'title' => strip_tags($title),
       'name' => check_plain(variable_get('site_name', 'Drupal')),
     );
   }
diff --git a/modules/node/node.test b/modules/node/node.test
index 4ffc88e..81269e2 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -1943,6 +1943,20 @@ class NodeTitleTestCase extends DrupalWebTestCase {
     // Test node title is clickable on teaser list (/node).
     $this->drupalGet('node');
     $this->clickLink($node->title);
+
+    // Test edge case where node title is set to 0.
+    $settings = array(
+      'title' => '0',
+    );
+    $node = $this->drupalCreateNode($settings);
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertTitle('0' . ' | Drupal', 'Page title is equal to 0.', 'Node');
+    // Test that 0 appears in the template <h1>.
+    $xpath = '//h1[@id="page-title"]';
+    $this->assertEqual(trim(current($this->xpath($xpath))),
+      '0',
+      'Node title is displayed as 0.',
+      'Node');
   }
 }
 
diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php
index bd61489..19a53f0 100644
--- a/modules/system/page.tpl.php
+++ b/modules/system/page.tpl.php
@@ -86,7 +86,7 @@
       <?php if ($site_name || $site_slogan): ?>
         <div id="name-and-slogan">
           <?php if ($site_name): ?>
-            <?php if ($title): ?>
+            <?php if (strlen($title)): ?>
               <div id="site-name"><strong>
                 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
               </strong></div>
@@ -126,7 +126,7 @@
         <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
         <a id="main-content"></a>
         <?php print render($title_prefix); ?>
-        <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
+        <?php if (strlen($title)): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
         <?php print render($title_suffix); ?>
         <?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>
         <?php print render($page['help']); ?>
diff --git a/themes/bartik/templates/page.tpl.php b/themes/bartik/templates/page.tpl.php
index 62f58d7..b877ff1 100644
--- a/themes/bartik/templates/page.tpl.php
+++ b/themes/bartik/templates/page.tpl.php
@@ -99,7 +99,7 @@
       <div id="name-and-slogan"<?php if ($hide_site_name && $hide_site_slogan) { print ' class="element-invisible"'; } ?>>
 
         <?php if ($site_name): ?>
-          <?php if ($title): ?>
+          <?php if (strlen($title)): ?>
             <div id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
               <strong>
                 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
@@ -187,7 +187,7 @@
       <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
       <a id="main-content"></a>
       <?php print render($title_prefix); ?>
-      <?php if ($title): ?>
+      <?php if (strlen($title)): ?>
         <h1 class="title" id="page-title">
           <?php print $title; ?>
         </h1>
diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php
index 326255c..c92f479 100644
--- a/themes/garland/page.tpl.php
+++ b/themes/garland/page.tpl.php
@@ -8,7 +8,7 @@
       <div id="header">
         <div id="logo-floater">
         <?php if ($logo || $site_title): ?>
-          <?php if ($title): ?>
+          <?php if (strlen($title)): ?>
             <div id="branding"><strong><a href="<?php print $front_page ?>">
             <?php if ($logo): ?>
               <img src="<?php print $logo ?>" alt="<?php print $site_name_and_slogan ?>" title="<?php print $site_name_and_slogan ?>" id="logo" />
@@ -42,7 +42,7 @@
           <a id="main-content"></a>
           <?php if ($tabs): ?><div id="tabs-wrapper" class="clearfix"><?php endif; ?>
           <?php print render($title_prefix); ?>
-          <?php if ($title): ?>
+          <?php if (strlen($title)): ?>
             <h1<?php print $tabs ? ' class="with-tabs"' : '' ?>><?php print $title ?></h1>
           <?php endif; ?>
           <?php print render($title_suffix); ?>
diff --git a/themes/seven/page.tpl.php b/themes/seven/page.tpl.php
index 6ab3ae8..866fd22 100644
--- a/themes/seven/page.tpl.php
+++ b/themes/seven/page.tpl.php
@@ -2,7 +2,7 @@
   <div id="branding" class="clearfix">
     <?php print $breadcrumb; ?>
     <?php print render($title_prefix); ?>
-    <?php if ($title): ?>
+    <?php if (strlen($title)): ?>
       <h1 class="page-title"><?php print $title; ?></h1>
     <?php endif; ?>
     <?php print render($title_suffix); ?>
