Permalink
Browse files

Prevent JsHelper::writeBuffer() to return empty lines (or empty onDom…

…Ready events)

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
1 parent 0bc1126 commit 2d9b13fe8884b15a986e1531517f562a07f3d7f3 kleingeist committed with markstory Dec 15, 2009
Showing with 4 additions and 0 deletions.
  1. +4 −0 cake/libs/view/helpers/js.php
@@ -195,6 +195,10 @@ function writeBuffer($options = array()) {
$defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true);
$options = array_merge($defaults, $options);
$script = implode("\n", $this->getBuffer($options['clear']));
+
+ if (empty($script)) {
+ return null;
+ }
if ($options['onDomReady']) {
$script = $this->{$this->__engineName}->domReady($script);

0 comments on commit 2d9b13f

Please sign in to comment.