Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1580)
+++ branches/2.8.x/CHANGELOG	(revision 1581)
@@ -11,6 +11,8 @@
 ! = Update/Change
 
 =========================== add small Features 2.8.2 ==========================
+17 Jan-2012 Build 1581 Werner v.d.Decken(DarkViper)
+# wysiwyg module some little typo fixes a.s.o.
 17 Jan-2012 Build 1580 Dietmar Woellbrink (Luisehahne)
 ! dropdown list to choose recipient for email confirmation
 16 Jan-2012 Build 1579 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1580)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1581)
@@ -52,5 +52,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1580');
+if(!defined('REVISION')) define('REVISION', '1581');
 if(!defined('SP')) define('SP', 'SP2');
Index: branches/2.8.x/wb/modules/wysiwyg/view.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/view.php	(revision 1580)
+++ branches/2.8.x/wb/modules/wysiwyg/view.php	(revision 1581)
@@ -21,11 +21,11 @@
 	throw new IllegalFileException();
 }
 /* -------------------------------------------------------- */
-$MEDIA_REL = WB_URL.MEDIA_DIRECTORY;
-// Get content
+$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
+// Get content 
 $content = '';
 $sql = 'SELECT `content` FROM `'.TABLE_PREFIX.'mod_wysiwyg` WHERE `section_id`='.(int)$section_id;
 if( ($content = $database->get_one($sql)) ) {
-	$content = str_replace('{SYSVAR:MEDIA_REL}',$MEDIA_REL, $content );
+	$content = str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content );
 }
 echo $content;
Index: branches/2.8.x/wb/modules/wysiwyg/save.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/save.php	(revision 1580)
+++ branches/2.8.x/wb/modules/wysiwyg/save.php	(revision 1581)
@@ -24,8 +24,7 @@
 // Include WB admin wrapper script
 require(WB_PATH.'/modules/admin.php');
 
-if (!$admin->checkFTAN())
-{
+if (!$admin->checkFTAN()) {
 	$admin->print_header();
 	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
 }
@@ -35,22 +34,23 @@
 // Include the WB functions file
 require_once(WB_PATH.'/framework/functions.php');
 
-$MEDIA_URL = WB_URL.MEDIA_DIRECTORY;
+$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
 // Update the mod_wysiwygs table with the contents
 if(isset($_POST['content'.$section_id])) {
     $content = $_POST['content'.$section_id];
-    $searchfor = '#(<.*= *\")('.quotemeta($MEDIA_URL).')(.*\".*>)#iU';
+	$searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU';
     $content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content);
-    $content = $admin->add_slashes($content);
 	// searching in $text will be much easier this way
 	$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0);
-	$query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg SET content = '$content', text = '$text' WHERE section_id = '$section_id'";
-	$database->query($query);	
+    $content = $admin->add_slashes($content);
+	$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_wysiwyg` ';
+	$sql .= 'SET `content`=\''.$content.'\', `text`=\''.$text.'\' ';
+	$sql .= 'WHERE `section_id`='.(int)$section_id;
+	$database->query($sql);
 }
 
 $sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$section['section_id'] : '' );
-if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION)
-{
+if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION){
     $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id;
 } else {
     $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
@@ -60,7 +60,7 @@
 if($database->is_error()) {
 	$admin->print_error($database->get_error(), $js_back);
 } else {
-	$admin->print_success($MESSAGE['PAGES']['SAVED'], $edit_page );
+	$admin->print_success($MESSAGE['PAGES_SAVED'], $edit_page );
 }
 
 // Print admin footer
Index: branches/2.8.x/wb/modules/wysiwyg/modify.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1580)
+++ branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1581)
@@ -23,11 +23,11 @@
 }
 /* -------------------------------------------------------- */
 
-$MEDIA_REL = WB_URL.MEDIA_DIRECTORY;
+$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
 // Get page content
 $sql = 'SELECT `content` FROM `'.TABLE_PREFIX.'mod_wysiwyg` WHERE `section_id`='.(int)$section_id;
 if ( ($content = $database->get_one($sql)) ) {
-	$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}',$MEDIA_REL, $content));
+	$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content));
 }else {
 	$content = '';
 }
@@ -71,4 +71,4 @@
 		</tr>
 	</table>
 </form>
-<br />
\ No newline at end of file
+<br />
