From b42e2b6760988c8308858e53ca8460664e0c88c3 Mon Sep 17 00:00:00 2001
From: Steven Wittens <steven@10.no-reply.drupal.org>
Date: Wed, 20 Apr 2005 03:01:07 +0000
Subject: [PATCH]   - Make the auto-linebreak filter also ignore the contents
 of <script>.     This makes it easier to use JavaScript (e.g. Google Adsense)
 inside blocks.

---
 modules/filter.module        | 2 +-
 modules/filter/filter.module | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/filter.module b/modules/filter.module
index c77c51351e96..05d875419354 100644
--- a/modules/filter.module
+++ b/modules/filter.module
@@ -956,7 +956,7 @@ function _filter_autop($text) {
     if ($i % 2) {
       // Opening or closing tag?
       $open = ($chunk{1} != '/');
-      list(, $tag) = split('[< ]', $chunk);
+      list($tag) = split('[ >]', substr($chunk, 2 - $open), 2);
       if (!$ignore) {
         if ($open) {
           $ignore = true;
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index c77c51351e96..05d875419354 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -956,7 +956,7 @@ function _filter_autop($text) {
     if ($i % 2) {
       // Opening or closing tag?
       $open = ($chunk{1} != '/');
-      list(, $tag) = split('[< ]', $chunk);
+      list($tag) = split('[ >]', substr($chunk, 2 - $open), 2);
       if (!$ignore) {
         if ($open) {
           $ignore = true;
-- 
GitLab