Heine

  • drupal
  • drupal core commits
  • about
Home

Commit 214122 by goba

#193577 by Rob Loach, Damien Tournoud, andypost: JavaScript string split() function does not behave like PHP explode(); causes problems with multiple node body break tags

--- misc/teaser.js      2008/01/09 12:10:04     1.12
+++ misc/teaser.js      2009/05/20 11:50:54     1.12.2.1
@@ -71,10 +71,10 @@
     $(include).parent().parent().before(button);
 
     // Extract the teaser from the body, if set. Otherwise, stay in joined mode.
-    var text = body.val().split('<!--break-->', 2);
-    if (text.length == 2) {
-      teaser[0].value = trim(text[0]);
-      body[0].value = trim(text[1]);
+    var text = body.val().split('<!--break-->');
+    if (text.length >= 2) {
+      teaser[0].value = trim(text.shift());
+      body[0].value = trim(text.join('<!--break-->'));
       $(teaser).attr('disabled', '');
       $('input', button).val(Drupal.t('Join summary')).toggle(join_teaser, split_teaser);
     }

No votes yet
  • Drupal Core
  • Download patch

Recent posts

  • Drupal 6: $base_path doesn't always point to the frontpage
  • XNA SoundEffect ContentLoadException
  • A new form element in Drupal core
  • The backstabbing March-Hare
  • Drupal HEAD and HTTP 500 errors on IIS 7

All-time popular content

  • Update UID 1 password via JS
  • Keeping an eye on Drupal core
  • Subversion on Strato V-PowerServer
  • A new form element in Drupal core
  • Access denied - Are you sure?
more

Tags

Captcha Coding Drupal FAPI IIS Let's hope it doesn't become popular Performance PHP Planet Drupal Quiz Security V-PowerServer
more tags
  • drupal
  • drupal core commits
  • about

Copyright © 2009 by Heine Deelstra. All rights reserved.