From c3324b9a5049f0e8152fbc57e624a685621aa16c Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Mon, 29 May 2006 14:22:31 +0000
Subject: [PATCH] - Patch #58956 by timcn: prevent multiple class names from
 being glued together.

---
 misc/drupal.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/misc/drupal.js b/misc/drupal.js
index e697fc855b39..6bbe8fc7439a 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -259,7 +259,8 @@ function removeClass(node, className) {
   if (!hasClass(node, className)) {
     return false;
   }
-  node.className = eregReplace('(^| )'+ className +'($| )', '', node.className);
+  // Replaces words surrounded with whitespace or at a string border with a space. Prevents multiple class names from being glued together.
+  node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className);
   return true;
 }
 
-- 
GitLab