Page 1 of 2

[SOLVED] Bad code in editable area - Problems after last update

Posted: Tue Oct 24, 2017 8:43 am
by glenshee
:( 1. Sorry for my english - Long story short - after last update (to 2.3.2) - im getting an extra code in edit area ...
<div data-target="blocks" id="subside" class="editText editable"><div align="center">Once upon a time, there was a tavern<br>
Where we used to raise a glass or two<br>
Remember how we laughed away the hours,<br>
Think of all the great things we would do<br>
</div></div> <li class="active"><a href="http://w3q.eu/home">Home</a></li> Website title ©2017 Your website
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstr ... "></script>
<script src="https://cdn.jsdelivr.net/jquery.autosiz ... "></script>
<script src="https://cdn.jsdelivr.net/taboverride/4. ... "></script>
<script src="https://cdn.jsdelivr.net/jquery.tabover ... "></script>
<script>$(document).tabOverride(!0,"textarea");function nl2br(a){return(a+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2")}function fieldSave(a,b,c,d,e){$("#save").show(),$.post("",{fieldname:a,token:token,content:b,target:c,menu:d,visibility:e},function(a){}).always(function(){window.location.reload()})}var changing=!1;$(document).ready(function(){$('body').on('click','div.editText',function(){changing||(a=$(this),title=a.attr("title")?title='"'+a.attr("title")+'" ':"",a.hasClass("editable")?a.html("<textarea "+title+' id="'+a.attr("id")+'_field" onblur="fieldSave(a.attr(\'id\'),this.value,a.data(\'target\'),a.data(\'menu\'),a.data(\'visibility\'));">'+a.html()+"</div> <div data-target="blocks" id="subside" class="editText editable"><div align="center">Once upon a time, there was a tavern<br>
Where we used to raise a glass or two<br>
Remember how we laughed away the hours,<br>
Think of all the great things we would do<br>
</div></div> <li class="active"><a href="http://w3q.eu/home">Home</a></li> Website title ©2017 Your website
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstr ... "></script>
<script src="https://cdn.jsdelivr.net/jquery.autosiz ... "></script>
<script src="https://cdn.jsdelivr.net/taboverride/4. ... "></script>
<script src="https://cdn.jsdelivr.net/jquery.tabover ... "></script>
<script>$(document).tabOverride(!0,"textarea");function nl2br(a){return(a+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2")}function fieldSave(a,b,c,d,e){$("#save").show(),$.post("",{fieldname:a,token:token,content:b,target:c,menu:d,visibility:e},function(a){}).always(function(){window.location.reload()})}var changing=!1;$(document).ready(function(){$('body').on('click','div.editText',function(){changing||(a=$(this),title=a.attr("title")?title='"'+a.attr("title")+'" ':"",a.hasClass("editable")?a.html("<textarea "+title+' id="'+a.attr("id")+'_field" onblur="fieldSave(a.attr(\'id\'),this.value,a.data(\'target\'),a.data(\'menu\'),a.data(\'visibility\'));">'+a.html()+"

Re: Bad code in editable area - Problems after last update

Posted: Tue Oct 24, 2017 11:06 am
by wiz
1. What was your version prior to the update?
This usually happens when you have incorrectly nested or improperly closed <html> tags, it duplicates some of your content.
Create a backup and try to simply remove the extra code, but this may not work as you will have to solve the improperly closed html tags.

2. Can you check your theme.php for any HTML errors?
3. Can you remove the extra code or fix the nested/improperly closed <> tags?

Will gladly help you out on this one ;)

Re: Bad code in editable area - Problems after last update

Posted: Wed Oct 25, 2017 12:44 pm
by glenshee
same situation happens with my theme and default one ....
i paste my template code below (i want to create clean template :/ )
im after reinstalation to zero ... after returning to version 2.3.1 - problems gone :(

1. first installation was 2.2.0 / then update to 2.3.1 ... and last update - made this :/
2. checked by validator.w3.org
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">

<title><?=wCMS::get('config','siteTitle')?> - <?=wCMS::page('title')?></title>

<?php
header("Vary: User-Agent, Accept");
?>

<meta name="description" content="<?=wCMS::page('description')?>">
<meta name="keywords" content="<?=wCMS::page('keywords')?>">

<meta name="author" content="Glider">

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstr ... ap.min.css">

<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ ... "></script>
<![endif]-->
</head>

<body>
<?=wCMS::alerts()?>
<?=wCMS::settings()?>
<?=wCMS::page('content')?>
<?=wCMS::block('subside')?>
<?=wCMS::menu()?>
<?=wCMS::get('config','siteTitle')?>
<?=wCMS::footer()?>

<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstr ... "></script>
<?=wCMS::js()?>


</body>
</html>
<!-- <link rel="stylesheet" href="<?=wCMS::asset('css/style.css')?>"> -->
<?=wCMS::css()?>

Re: Bad code in editable area - Problems after last update

Posted: Wed Oct 25, 2017 6:43 pm
by wiz
I've tested WonderCMS 2.3.2 with your theme.php (a bit modified), without any issues.

Code: Select all

<!doctype html>

<html lang="en">
<head>
    <meta charset="utf-8">
    
    <title><?=wCMS::get('config','siteTitle')?> - <?=wCMS::page('title')?></title>
    
    <?php header("Vary: User-Agent, Accept"); ?>
    
    <meta name="description" content="<?=wCMS::page('description')?>">
    <meta name="keywords" content="<?=wCMS::page('keywords')?>">
    
    <meta name="author" content="Glider">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>

<body>
    <?=wCMS::alerts()?>
    <?=wCMS::settings()?>
    <?=wCMS::page('content')?>
    <?=wCMS::block('subside')?>
    <?=wCMS::menu()?>
    <?=wCMS::get('config','siteTitle')?>
    <?=wCMS::footer()?>
    
    <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <?=wCMS::js()?>
</body>
</html>
<link rel="stylesheet" href="<?=wCMS::asset('css/style.css')?>">
<?=wCMS::css()?> 
Below is an attached fresh WonderCMS 2.3.2 with the above theme.php. Can you please give this a try?
This seems like a theme issue and we haven't made any drastic changes from 2.3.1 to 2.3.2 (changes history -> https://www.wondercms.com/whatsnew). Like I mentioned earlier, with the attached ZIP version, everything works fine, I unfortunately could not reproduce the error you're encountering.

Please report back so we can fix the issue (if you'll still have it).

Re: Bad code in editable area - Problems after last update

Posted: Wed Oct 25, 2017 11:29 pm
by glenshee
1. login url takes me here https://www.wondercms.com/index.php?pag ... r/loginURL
2. ive deleted database.js - and default loginurl gives me 404
3. ive send you a pm with link to phpinfo
EDIT:
4. edit: ive added .htaccess - works ... but the problem return when ive pasted some code to editable area ...

Re: Bad code in editable area - Problems after last update

Posted: Wed Oct 25, 2017 11:50 pm
by wiz
Can you give me an example of code you are trying to paste? I am unable to replicate the issue with my samples of code.

Please put it in [ code ] [/ code ] tags.

EDIT: Additional question:
1. Is there anything in your server error logs?

Re: Bad code in editable area - Problems after last update

Posted: Thu Oct 26, 2017 12:00 am
by wiz
For further reference, below is a list of changes from 2.3.1 to 2.3.2:
- Additional ISSET checks to prevent PHP notices (errors).
- Prettified code.
- Header HTTP 1.0 to 1.1.
- Updated theme and plugin links.
- Minor text changes.
- Removing forced converted case for page titles.

I am going through the version changes (listed here: https://github.com/robiso/wondercms/com ... 7d8c763325 ) and I don't see anything that could cause any changes in how the content is saved.

Looking forward to testing your pasted code.

Re: Bad code in editable area - Problems after last update

Posted: Thu Oct 26, 2017 1:04 am
by glenshee
ill write you later - step by step :D my guide to "train wreck" this CMS ... :) [im sorry but here at this moment i 3:00 in night - i must sleep for a while]

Re: Bad code in editable area - Problems after last update

Posted: Thu Oct 26, 2017 10:45 am
by wiz
Can't wait for the train wreck! :D

Re: Bad code in editable area - Problems after last update

Posted: Fri Oct 27, 2017 7:53 am
by glenshee
1. Fresh installation ... downloaded WonderCMS-2.3.2.zip - extract with 7 zip / upload via filezilla ...
2. It's alive! - security setup - address and password
3. General - delete example page
4. title / keywords / description
5. upload "clean theme" from your post
6. deleted default theme
7. setup footer...

Code: Select all

&copy; 2010<script>new Date().getFullYear()>2010&&document.write("-"+new Date().getFullYear());</script>, Company.
deleted footer and everything is OK ... it must be a some kind of browser cache kind of stuck situation ... JS loop ....

edit: ive cheked my backup twice - in .htaccess - ive putted this code

Code: Select all

<IfModule mod_headers.c>
  <FilesMatch "\.(js|css|xml|gz)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
</IfModule>