Impossible to edit
Re: Impossible to edit
Yeeess !
It works.
Thank you again.
So it was the hoster not being able to cope with gzip the compression ?
It works.
Thank you again.
So it was the hoster not being able to cope with gzip the compression ?
Re: Impossible to edit
Most likely the issue is, that the routine implementing the use_gzip="true" variant is conceptionally broken. It seems to me there is a race condition involved, that is not properly handled (after executing tinyMCE_GZ.init(), the code does not necessarily wait for the definition of tinyMCE to be loaded; if that takes too long for whatever reason, instantiating TinyMCE will fail).[1] However, there will be no problems on servers where the PHP ini setting zlib.output_compression is On (you can check that under "System Info and Help" -> "PHP Info"). If that setting is Off, you should set use_gzip="" to be on the safe side.delan10 wrote:So it was the hoster not being able to cope with gzip the compression ?
PS: [1] No, that is not true. The code properly waits as the XHR is done asynchronously. I have to assume that the problem is due to plugins/MLDtinymce_XH/tiny_mce/tiny_mce_gzip.php failing to send the proper response. To find out the reason, debugging would be necessary. Anyway, the workaround setting use_gzip="" seems to work, so I suggest to stick with it and not wasting more time on this issue.
Last edited by cmb on Tue Oct 29, 2013 2:49 pm, edited 1 time in total.
Reason: added PS
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH
Re: Impossible to edit
Thanx again for your help and your explanations !
Bonus question :
Do you know if it is possible to use this tinymce plugin with the plugin realblog XH in a cmsimple 1.4.4 installation ? What should I do to integrate it ?
Bonus question :
Do you know if it is possible to use this tinymce plugin with the plugin realblog XH in a cmsimple 1.4.4 installation ? What should I do to integrate it ?
Re: Impossible to edit
You're welcome.delan10 wrote:Thanx again for your help and your explanations !
I assume it is possible to use the tinymce plugin for Realblog (the _XH suffix was removed a while ago), but I presume it is a lot of work to get that right. Certainly, it would be simpler to upgrade to CMSimple_XH 1.5.9, where TinyMCE can be easily used for Realblog.delan10 wrote:Do you know if it is possible to use this tinymce plugin with the plugin realblog XH in a cmsimple 1.4.4 installation ? What should I do to integrate it ?
Christoph M. Becker – Plugins for CMSimple_XH
Re: Impossible to edit
OK thank you.I assume it is possible to use the tinymce plugin for Realblog (the _XH suffix was removed a while ago), but I presume it is a lot of work to get that right. Certainly, it would be simpler to upgrade to CMSimple_XH 1.5.9, where TinyMCE can be easily used for Realblog.
In fact the problem is that it is impossible to edit an existing post with realblog (v. XH 1.2) since the hoster (1&1) activated php5.4.
I can create a post but when I try to edit them it deletes the whole post, which is a bit annoying...
Important precision : if the post contains no special characters like é à ù everything is OK.
So once again this has to do with iso and utf8... And this is why I wanted to use tinymce instead of fckeditor, which doesn't work on php5.4 and xh 1.4.4.
Do you think I can use a more recent version of realblog on the concerned cmsimple xh 1.4.4 installations to resolve the problem ?
Or maybe there is a solution to the problem by just modifying 1 or 2 php or js files ? But what to modify ?
I know switching to xh 1.5.9 would be a solution, but for those existing websites I would prefer an "easier" solution that allows me to encode in iso with realblog, whick was possible under earlier php versions.
Re: Impossible to edit
Ah, I see. I assume this is caused by a slight change of htmlspecialchars() and htmlentities(): in PHP 5.4 the $encoding parameter was changed to default to 'UTF-8'. The result of calling htmlspecialchars() on a string containing invalid UTF-8 byte sequences will be an empty string. See http://cmsimpleforum.com/viewtopic.php?f=29&t=6373 for further details regarding this issue and http://sourceforge.net/p/cmsimplexh/code/859/ for the changes that have been done to CMSimple_XH 1.1.7 to cater for it (containing the necessary changes for FCKEditor to run on PHP 5.4).delan10 wrote:In fact the problem is that it is impossible to edit an existing post with realblog (v. XH 1.2) since the hoster (1&1) activated php5.4.
I can create a post but when I try to edit them it deletes the whole post, which is a bit annoying...
It might suffice to add the desired encoding ('ISO-8859-1') explicitely to all htmlspecialchars() and htmlentities(). A quick search shows only 2 htmlspecialchars() in plugins/realblog/admin.php and 2 in plugins/realblog/index.php. For instance, plugins/realblog/admin.php in line 713 you would have to replace:
Code: Select all
htmlspecialchars($realblog_headline)
Code: Select all
htmlspecialchars($realblog_headline, ENT_COMPAT, 'ISO-8859-1')
No, I don't think so. Likely, they're going to introduce even more problems with regard to non UTF-8 encodings. However, they may fix bugs and vulnerabilities.delan10 wrote:Do you think I can use a more recent version of realblog on the concerned cmsimple xh 1.4.4 installations to resolve the problem ?
I understand why you're looking for an easy solution. The suggestions given above may be such. However, there might be other issues, and at least your hoster switching to a newer version of PHP might introduce new ones, so I generally recommend upgrading to the latest version of CMSimple_XH as soon as possible, and always keep plugins up-to-date.delan10 wrote:I know switching to xh 1.5.9 would be a solution, but for those existing websites I would prefer an "easier" solution that allows me to encode in iso with realblog, whick was possible under earlier php versions.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Impossible to edit
That's it. And that's also the resason why I switched back to tinymce for all my websites running under xh1.4.4 once the hoster 1&1 adopted php5.4.Ah, I see. I assume this is caused by a slight change of htmlspecialchars() and htmlentities(): in PHP 5.4 the $encoding parameter was changed to default to 'UTF-8'. The result of calling htmlspecialchars() on a string containing invalid UTF-8 byte sequences will be an empty string. See http://cmsimpleforum.com/viewtopic.php?f=29&t=6373 for further details regarding this issue and http://sourceforge.net/p/cmsimplexh/code/859/ for the changes that have been done to CMSimple_XH 1.1.7 to cater for it (containing the necessary changes for FCKEditor to run on PHP 5.4).
Your solution works great for the "teasing" part.For instance, plugins/realblog/admin.php in line 713 you would have to replace:
Code: Select all
htmlspecialchars($realblog_headline)
with
Code: Select all
htmlspecialchars($realblog_headline, ENT_COMPAT, 'ISO-8859-1')
But same problem for the full post when trying to edit it (see screenshot)
There might be another place to add the piece of code you proposed ?
[ external image ]
Indeed, I'm more and more aware of this. I will definitely consider the upgrade option, but right now I'd be glad if we could find a solution for realblog/fck to accept iso characters !I understand why you're looking for an easy solution. The suggestions given above may be such. However, there might be other issues, and at least your hoster switching to a newer version of PHP might introduce new ones, so I generally recommend upgrading to the latest version of CMSimple_XH as soon as possible, and always keep plugins up-to-date.
Re: Impossible to edit
You could have said so from the beginning.delan10 wrote:That's it. And that's also the resason why I switched back to tinymce for all my websites running under xh1.4.4 once the hoster 1&1 adopted php5.4.
The full solution I pointed out should work for both the teaser as well as the article:delan10 wrote:Your solution works great for the "teasing" part.
[...]
There might be another place to add the piece of code you proposed ?
I only did mention 1 example of the 4 occurances of htmlspecialchars(). All 4 modifications (in a single block of code; the comments show the files and line numbers):cmb wrote:It might suffice to add the desired encoding ('ISO-8859-1') explicitely to all htmlspecialchars() and htmlentities(). A quick search shows only 2 htmlspecialchars() in plugins/realblog/admin.php and 2 in plugins/realblog/index.php. For instance,
Code: Select all
// admin.php line, 713
$t.="<tr><td colspan=\"5\"><textarea class=\"realblog_headline_field\" name=\"realblog_headline\" id=\"realblog_headline\" rows=\"3\" cols=\"60\">".htmlspecialchars($realblog_headline, ENT_COMPAT, 'ISO-8859-1')."</textarea></td></tr>";
// admin.php, line 758
$t.="<tr><td colspan=\"5\"><textarea class=\"realblog_story_field\" name=\"realblog_story\" id=\"realblog_story\" rows=\"30\" cols=\"80\">" . htmlspecialchars($realblog_story, ENT_COMPAT, 'ISO-8859-1') . "</textarea></td></tr>";
// index.php line, 1914
$title="<title>" . htmlspecialchars(stripslashes($record[REALBLOG_TITLE]), ENT_COMPAT, 'ISO-8859-1') . "</title>\n";
// index.php line, 1916
$description="<description>" . htmlspecialchars(stripslashes($record[REALBLOG_HEADLINE]), ENT_COMPAT, 'ISO-8859-1') . "</description>\n";
Code: Select all
// FCEditor/fckeditor_php5.php, line 159
$HtmlValue = htmlspecialchars( $this->Value, ENT_COMPAT, 'ISO-8859-1' ) ;
// cmsimple/fckeditor.php, line 197
.htmlspecialchars ($c[$s], ENT_COMPAT, 'ISO-8859-1')
Christoph M. Becker – Plugins for CMSimple_XH
Re: Impossible to edit
Wonderful ! It works like a charm ! Thank you very much
These 2 small modifications would have saved me hours of stress and work as it indeed allows me to edit ISO characters with all my XH_1.4.4 websites (both for standard content pages and for realblog) !!!
Once again, THANK YOU.
I wish I told you about my problem at the time 1&1 switched to php5.4....Furthermore you might need to do the following modifications (it seems they are sufficient to use the FCKEditor to edit the page contents):
Code: Select all
// FCEditor/fckeditor_php5.php, line 159
$HtmlValue = htmlspecialchars( $this->Value, ENT_COMPAT, 'ISO-8859-1' ) ;
// cmsimple/fckeditor.php, line 197
.htmlspecialchars ($c[$s], ENT_COMPAT, 'ISO-8859-1')
These 2 small modifications would have saved me hours of stress and work as it indeed allows me to edit ISO characters with all my XH_1.4.4 websites (both for standard content pages and for realblog) !!!
Once again, THANK YOU.
Re: Impossible to edit
Fine.delan10 wrote:Wonderful ! It works like a charm ! Thank you very much
Well, you may have been even better off, if you would have used (resp. sticked to) CMSimple_XH 1.1x in the first place[1]. The switch to UTF-8 in XH 1.2 was necessary in the long run (and, in my opinion, long time overdue), but unfortunately, it was kept optional, as one could configure an alternative encoding, what was a fault IMO, because catering for single byte and multi byte encodings simultaneously in PHP is a PITA. Making UTF-8 mandatory only happened in CMSimple_XH 1.5.2 (and since then the glitches regarding the character encoding have slowly vanished[2]). That was the reason for us to still support XH 1.1.x. However, XH 1.1.x is going to reach its end of life, and so all users of ANSI encoded CMSimple installations should prepare to switch to UTF-8 in the not to far future. This, undoubtably, requires quite some effort, but it has its benefits, too. The CMSimple_XH demo already shows some of them, and XH 1.6 is going to bring even some more--and don't forget about new (versions of) plugins, which usually are prepared for UTF-8 and often require this character encoding.delan10 wrote:I wish I told you about my problem at the time 1&1 switched to php5.4....
These 2 small modifications would have saved me hours of stress and work as it indeed allows me to edit ISO characters with all my XH_1.4.4 websites (both for standard content pages and for realblog) !!!
[1] Of course, downgrading is counter-intuitive, and might bring up other issues.
[2] There are still issues regarding non UTF-8 encoded file systems, but these can be avoided by only using ASCII characters for file and folder names.
Christoph M. Becker – Plugins for CMSimple_XH