Revision 1910
Added by Dietmar over 11 years ago
save.php | ||
---|---|---|
4 | 4 |
* @category backend |
5 | 5 |
* @package wysiwyg |
6 | 6 |
* @author WebsiteBaker Project |
7 |
* @copyright 2009-2012, Website Baker Org. e.V.
|
|
8 |
* @link http://www.websitebaker2.org/
|
|
7 |
* @copyright 2009-2013, WebsiteBaker Org. e.V.
|
|
8 |
* @link http://www.websitebaker.org/
|
|
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 |
* @platform WebsiteBaker 2.8.x
|
|
10 |
* @platform WebsiteBaker 2.8.4
|
|
11 | 11 |
* @requirements PHP 5.2.2 and higher |
12 | 12 |
* @version $Id$ |
13 |
* @filesource $HeadURL$
|
|
13 |
* @filesource $HeadURL$
|
|
14 | 14 |
* @lastmodified $Date$ |
15 | 15 |
* |
16 | 16 |
*/ |
... | ... | |
34 | 34 |
// Include the WB functions file |
35 | 35 |
require_once(WB_PATH.'/framework/functions.php'); |
36 | 36 |
$aErrors = array(); |
37 |
$sMediaUrl = WB_URL.MEDIA_DIRECTORY; |
|
37 |
//$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
|
|
38 | 38 |
// Update the mod_wysiwygs table with the contents |
39 | 39 |
if(isset($_POST['content'.$section_id])) { |
40 | 40 |
$content = $_POST['content'.$section_id]; |
41 |
if(ini_get('magic_quotes_gpc')==true) |
|
42 |
{ |
|
43 |
$content = $admin->strip_slashes($_POST['content'.$section_id]); |
|
44 |
}; |
|
45 |
$searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU'; |
|
46 |
$content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content); |
|
41 |
$content = $admin->ReplaceAbsoluteMediaUrl($content); |
|
47 | 42 |
// searching in $text will be much easier this way |
48 | 43 |
$content = WbDatabase::getInstance()->escapeString ($content); |
49 | 44 |
$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0); |
... | ... | |
57 | 52 |
$aErrors[] = $MESSAGE['GENERIC_NOT_UPGRADED'].((defined('DEBUG') && DEBUG) ? '<br />'.$MESSAGE['FRONTEND_SORRY_NO_ACTIVE_SECTIONS'] : ''); |
58 | 53 |
} |
59 | 54 |
|
60 |
$sec_anchor = '#'.(defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' ) ? SEC_ANCHOR.$section_id : 'section_'.$section_id );
|
|
55 |
$sSectionIdPrefix = ( defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' ) ? SEC_ANCHOR : 'Sec' );
|
|
61 | 56 |
if(defined('EDIT_ONE_SECTION') and EDIT_ONE_SECTION){ |
62 | 57 |
$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id; |
63 | 58 |
} else { |
64 |
$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor;
|
|
59 |
$edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'#'.$sSectionIdPrefix.$section_id;
|
|
65 | 60 |
} |
66 | 61 |
|
67 | 62 |
// Check if there is a database error, otherwise say successful |
Also available in: Unified diff
! modules/wysiwyg/save.php use new methode in class.wb to replace absolute MediaUrl