Recent Topics

1 Mar 24, 2012 23:11    

b2evolution supports PHP 5.4 since version 4.1.5b
http://b2evolution.net/downloads/index.html

Hello,

I have upgraded php from release 5.3 to 5.4. With 5.3, b2evolution ran fine but doesn't work anymore with php 5.4. For example, it is impossible to write a comment (you can try : http://grincheux.de-charybde-en-scylla.fr/).

Other trouble : I cannot modify a text when is it saved in database (editor only contains a empty page).

I have tried to obtain error message without success. All other php applications run fine. Only b2evolution hangs.

Any idea ? Thanks in advance,

JKB

3 Mar 25, 2012 00:30

I'm updating my local PHP test server to v5.4

4 Mar 25, 2012 00:46

Ok, I just found out that b2evolution [u]IS NOT COMPATIBLE[/u] with PHP 5.4 yet. I get a shedload of errors :(

5 Mar 25, 2012 01:13

sam2kb wrote:

Ok, I just found out that b2evolution [u]IS NOT COMPATIBLE[/u] with PHP 5.4 yet. I get a shedload of errors :(

better get hands on that : D thats not good news

6 Mar 25, 2012 04:25

Yeah, I'm working on it right now. Already fixed TONS of errors :)

7 Mar 25, 2012 08:28

Here's the pre-4.1.4 version
http://www.sonorth.com/travel/download/WOD8R6XREZ

If you want to see the changes, compare it to v4.1.3 with WinMerge or any other diff tool.

This version [u]should[/u] be compatible with PHP 5.4. Even though I fixed a lot of errors, there might be more that I missed. To see (and report here) the errors, make sure you have the following string in your php.ini file.

error_reporting = E_ALL & ~E_STRICT

There are still a bunch of E_STRICT errors in b2evolution. Luckily they are only informative and don't cause problems (yet). We will fix them later.

8 Mar 25, 2012 10:46

Thanks a lot. I will try as soon as possible.

10 Mar 25, 2012 18:16

There will be no visual differences, I only fixed bugs appeared in PHP 5.4

You still haven't deleted the Captcha plugin, which is incompatible with b2evo v4.1

11 Mar 25, 2012 18:19

I see no difference between 4.1.3 and 4.1.4-dev.

Have you checked the code? Are you sure that you uploaded new files to the server?

You don't need to run the installer, just upload overwriting files. I will create a patch with changed files only to make the update process easier.

12 Mar 25, 2012 19:19

When I said "I see no difference", it is not in b2evo code itself. With 4.1.3 and 4.1.4-dev, I see same issue.

If I disable captcha, public web pages run fine (but captcha worked fine with 4.1.3). Now, only editor doesn't work as exptected. If I want to edit an old post, only post title is reported in editor, not all text.

14 Mar 25, 2012 20:46

Is this your own server? Can you edit php.ini file on it?

Other trouble : on bottom, right button should contain a label

Yep. I see it.

16 Mar 26, 2012 09:49

Edit the following directives, get errors, post them here and revert php.ini changes (if you want to)

error_reporting = E_ALL & ~E_STRICT
display_errors = On

17 Mar 26, 2012 10:03

I have done. Since last saturday, php runs with these options and I don't see any error message.

18 Mar 26, 2012 10:16

Something is muting errors. Are you using my 4.1.4 version as it is?

As of missing button text, see how that string is translated in /locales/fr_FR/_global.php, Search for

'Preview/Add file' => 'Prévisualiser/Ajouter fichier',


Try to comment it

// 'Preview/Add file' => 'Prévisualiser/Ajouter fichier',


The button work fine in my test install.

Also what's your OS and where did you get PHP 5.4 from?

19 Mar 26, 2012 10:27

sam2kb wrote:

Something is muting errors. Are you using my 4.1.4 version as it is?

Yes, I believe it's yours. I have unzipped your archive in b2evolution directory.

As of missing button text, see how that string is translated in /locales/fr_FR/_global.php, Search for

'Preview/Add file' => 'Prévisualiser/Ajouter fichier',


Try to comment it

// 'Preview/Add file' => 'Prévisualiser/Ajouter fichier',


The button works fine in my test install.

Very strange, I don't find this line in my localization file...

Also what's your OS and where did you get PHP 5.4 from?

Linux Debian/wheezy up to date.

Best regards,

JKB

20 Mar 26, 2012 10:33

Very strange, I don't find this line in my localization file...

Wrong version :)
The text should read

'Preview' => 'Prévisualiser',

21 Mar 26, 2012 10:37

file -i _global.php
_global.php: text/x-php; charset=iso-8859-1

If I comment out this line, right button contains 'Preview'.

22 Mar 26, 2012 11:28

If I replace "Prévisualiser" by "Previsualiser", right button contains "Previsualiser". Maybe an encoding trouble ?

23 Mar 26, 2012 12:18

I confirm that issue I see comes from encoding trouble. All data that contains non ASCII characters disappear.

24 Mar 26, 2012 14:54

That might be the reason why you still have problems running my modified version

25 Mar 26, 2012 15:00

OK. And how can I fix it ? Is there any workaround ?

26 Mar 26, 2012 15:27

Can you post here or PM me a link to your website?
I usually recommend to switch to UTF-8, however you should not have any problems with French language on iso-8859-1 charset.

28 Mar 26, 2012 16:00

Sure, I forgot that you posted the links before :)

I'm out of ideas then. Try to upload /locales/fr_FR/ folder from v4.1.3

29 Mar 26, 2012 16:17

I have tried without success. Trouble began when I have upgraded php from 5.3 to 5.4.

30 Mar 26, 2012 16:35

I have seen that some new options regarding transliterations have been added to php.ini since php 5.3 (zend.script_encoding for example).

And with php 5.4, internal encoding is UTF8. In 5.3, it was iso-8859-1. I'm pretty sure that this bug comes from this encoding, but I'm not able to fix it.

31 Mar 26, 2012 16:38

Can't you select default encoding in php.ini ?
You can also easily switch b2evo to utf-8, I'm not sure if it'll help.

32 Mar 26, 2012 17:25

Of course, I have tried to force default encoding in php.ini. Without success.

Why can I switch b2evo in UTF8 ? I suppose I have to convert localization files and headers. Right ?

33 Apr 03, 2012 07:21

I've edited my local installation to work in PHP 5.4 without error. I could send in a patch if I knew where to send it to.

34 Apr 21, 2012 13:16

Hi,

I'm also stuck since I upgrade php to 5.4 (debian package). I can add new post but when I want to modify them, if there's any accentuated character, I get an empty form.

Could you post your customization to help us. Thanks

Regards

Laurent

35 Apr 21, 2012 16:05

b2evolution v4.1.4 should work fine. Are you using that version?

36 Apr 21, 2012 17:21

Sorry, I forget to say that I've tried with 4.05 and 4.1.4

I've dig into apache log but I did not found anything.

37 Apr 21, 2012 17:37

Please post here sample text

38 Apr 21, 2012 17:55

Please find attached a short part of a french recipe

--8<--
Gâteau au yaourt et au lait concentré sucré
* Nombre de personnes : 8
* Préparation : 10 min
* Cuisson : environ 30 min

Ingrédients :
* 1 pot de yaourt nature qui servira d'étalon
* 2 pots de farine
* 1 pot 1/2 de sucre
...
-->8--

http://www.softndesign.org/blog/stubs/cuisine.php/gateau-au-yaourt-et-au-1

I've force the charset definition to iso-8859-1 but it does not change anything
--8<--
<Directory /usr/local/share/b2evolution/>
AddDefaultCharset iso-8859-1
<IfModule mod_php5.c>
php_value default_charset "ISO-8859-1"
</IfModule>
</Directory>
-->8--

39 Apr 21, 2012 23:05

I confirm the bug.
For a quick fix edit /inc/_core/_misc.funcs.php This should fix most input fields, there still a lot of other places where htmlspecialchars function is used.

line 243

global $Plugins, $current_charset;

lines 264 and 291

$content = htmlspecialchars( $content, ENT_QUOTES, $current_charset );

You don't need to edit apache config.

40 Apr 22, 2012 19:22

Thanks, that's works!

It seems that, since php 5.4, htmlspecialchars assumes UTF-8 instead of ISO-8859-1.

To get all localized buttons, I need to patch more deeper the code. Please find attached my patch (on b2evolution 4.1.4):


diff -ru b2evolution.orig/blogs/cron/getmail.php b2evolution/blogs/cron/getmail.php
--- b2evolution.orig/blogs/cron/getmail.php	2012-04-22 17:00:31.134400497 +0200
+++ b2evolution/blogs/cron/getmail.php	2012-04-22 17:00:32.010422423 +0200
@@ -326,7 +326,7 @@
 		if( $filename == '' )
 		{
 			$filename = tempnam( $mediadir, 'upload' ) . '.' . $attachment['SubType'];
-			echo_message( '&#x279C; ' . sprintf('Attachment without name. Using "%s".', htmlspecialchars( $filename )), WARNING, 2 );
+			echo_message( '&#x279C; ' . sprintf('Attachment without name. Using "%s".', myhtmlspecialchars( $filename )), WARNING, 2 );
 		}
 		$filename = preg_replace( '/[^a-z0-9\-_.]/', '-', $filename );
 
@@ -351,10 +351,10 @@
 
 		if( $do_real_posting )
 		{
-			echo_message( '&#x279C; Saving file to: ' . htmlspecialchars( $mediadir . $filename  ), INFO, 3 );
+			echo_message( '&#x279C; Saving file to: ' . myhtmlspecialchars( $mediadir . $filename  ), INFO, 3 );
 			if( !rename( $attachment['DataFile'], $mediadir . $filename ) )
 			{
-				echo_message( '&#x2718; Problem saving upload to ' . htmlspecialchars( $mediadir . $filename ), WARNING, 2 );
+				echo_message( '&#x2718; Problem saving upload to ' . myhtmlspecialchars( $mediadir . $filename ), WARNING, 2 );
 				$return = false; // return: at least one error. try with next attachment
 				continue;
 			}
@@ -580,7 +580,7 @@
 	$a_authentication = explode( ':', $a_body[0], 2 );
 	$content = trim( $a_body[1] );
 
-	echo_message( 'Message content:' . ' <code>' . htmlspecialchars( $content ) . '</code>', INFO, 3 );
+	echo_message( 'Message content:' . ' <code>' . myhtmlspecialchars( $content ) . '</code>', INFO, 3 );
 
 	$user_login = trim( $a_authentication[0] );
 	// TODO: dh> should the password really get trimmed here?!
@@ -590,7 +590,7 @@
 	echo_message( 'Authenticating user: ' . $user_login, INFO, 3 );
 	if( !user_pass_ok( $user_login, $user_pass ) )
 	{
-		echo_message( sprintf(T_( 'Authentication failed for user %s.' ), htmlspecialchars($user_login)), ERROR, 0 );
+		echo_message( sprintf(T_( 'Authentication failed for user %s.' ), myhtmlspecialchars($user_login)), ERROR, 0 );
 		echo_message( '&#x2718; Wrong login or password. First line of text in email must be in the format "username:password".', ERROR, 3 );
 		rmdir_r( $tmpDirMIME );
 		continue;
@@ -620,7 +620,7 @@
 	{
 		$post_category = $Settings->get( 'eblog_default_category' );
 	}
-	echo_message( 'Category ID: ' . htmlspecialchars( $post_category ), INFO, 3 );
+	echo_message( 'Category ID: ' . myhtmlspecialchars( $post_category ), INFO, 3 );
 
 	$content = xmlrpc_removepostdata( $content );
 	$blog_ID = get_catblog( $post_category ); // TODO: should not die, if cat does not exist!
@@ -699,8 +699,8 @@
 	}
 
 	echo_message( '&#x2714; Message posting successful.', SUCCESS, 2 );
-	echo_message( '&#x279C; Post title: ' . htmlspecialchars( $post_title ), INFO, 3 );
-	echo_message( '&#x279C; Post content: ' . htmlspecialchars( $content ), INFO, 3 );
+	echo_message( '&#x279C; Post title: ' . myhtmlspecialchars( $post_title ), INFO, 3 );
+	echo_message( '&#x279C; Post content: ' . myhtmlspecialchars( $content ), INFO, 3 );
 
 	rmdir_r( $tmpDirMIME );
 
diff -ru b2evolution.orig/blogs/htsrv/viewfile.php b2evolution/blogs/htsrv/viewfile.php
--- b2evolution.orig/blogs/htsrv/viewfile.php	2012-04-22 17:00:31.122400197 +0200
+++ b2evolution/blogs/htsrv/viewfile.php	2012-04-22 17:00:31.998422123 +0200
@@ -237,7 +237,7 @@
 					{
 						echo ' '.str_pad($i+1, $linenr_width, ' ', STR_PAD_LEFT).' ';
 					}
-					echo '</span>'.htmlspecialchars( str_replace( "\t", '  ', $buffer[$i] ) );  // TODO: customize tab-width
+					echo '</span>'.myhtmlspecialchars( str_replace( "\t", '  ', $buffer[$i] ) );  // TODO: customize tab-width
 				}
 
 	  		echo '</pre>';
diff -ru b2evolution.orig/blogs/inc/antispam/antispam.ctrl.php b2evolution/blogs/inc/antispam/antispam.ctrl.php
--- b2evolution.orig/blogs/inc/antispam/antispam.ctrl.php	2012-04-22 17:00:31.030397893 +0200
+++ b2evolution/blogs/inc/antispam/antispam.ctrl.php	2012-04-22 17:00:31.910419921 +0200
@@ -87,7 +87,7 @@
 		// it has to be a minimum of 5 characters to avoid being too generic
 		if( evo_strlen($keyword) < 5 )
 		{
-			$Messages->add( sprintf( T_('The keyword &laquo;%s&raquo; is too short, it has to be a minimum of 5 characters!'), htmlspecialchars($keyword) ), 'error' );
+			$Messages->add( sprintf( T_('The keyword &laquo;%s&raquo; is too short, it has to be a minimum of 5 characters!'), myhtmlspecialchars($keyword) ), 'error' );
 			break;
 		}
 
@@ -97,7 +97,7 @@
 												WHERE hit_referer LIKE '.$DB->quote('%'.$keyword.'%'),
 												'Delete all banned hit-log entries' );
 
-			$Messages->add( sprintf( T_('Deleted %d logged hits matching &laquo;%s&raquo;.'), $r, htmlspecialchars($keyword) ), 'success' );
+			$Messages->add( sprintf( T_('Deleted %d logged hits matching &laquo;%s&raquo;.'), $r, myhtmlspecialchars($keyword) ), 'success' );
 		}
 
 		$delcomments = $deldraft || $delpublished || $deldeprecated;
@@ -118,14 +118,14 @@
 			// asimo> If a comment whith this keyword content was inserted here, the user will not even observe that (This is good)
 			$r = $DB->query('DELETE FROM T_comments
 			                  WHERE '.$keyword_cond.$del_condition );
-			$Messages->add( sprintf( T_('Deleted %d comments matching &laquo;%s&raquo;.'), $r, htmlspecialchars($keyword) ), 'success' );
+			$Messages->add( sprintf( T_('Deleted %d comments matching &laquo;%s&raquo;.'), $r, myhtmlspecialchars($keyword) ), 'success' );
 		}
 
 		if( $blacklist_locally )
 		{ // Local blacklist:
 			if( antispam_create( $keyword ) )
 			{
-				$Messages->add( sprintf( T_('The keyword &laquo;%s&raquo; has been blacklisted locally.'), htmlspecialchars($keyword) ), 'success' );
+				$Messages->add( sprintf( T_('The keyword &laquo;%s&raquo; has been blacklisted locally.'), myhtmlspecialchars($keyword) ), 'success' );
 				// Redirect so that a reload doesn't write to the DB twice:
 				if( $display_mode != 'js' )
 				{
diff -ru b2evolution.orig/blogs/inc/antispam/model/_antispam.funcs.php b2evolution/blogs/inc/antispam/model/_antispam.funcs.php
--- b2evolution.orig/blogs/inc/antispam/model/_antispam.funcs.php	2012-04-22 17:00:31.030397893 +0200
+++ b2evolution/blogs/inc/antispam/model/_antispam.funcs.php	2012-04-22 17:00:31.910419921 +0200
@@ -411,7 +411,7 @@
 	{
 		if( $noperms_count == 0 )
 		{ // There isn't any affected comment witch corresponding status
-			printf( '<p>'.T_('No %s comments match the keyword [%s].').'</p>', '<strong>'.$status.'</strong>', htmlspecialchars($keyword) );
+			printf( '<p>'.T_('No %s comments match the keyword [%s].').'</p>', '<strong>'.$status.'</strong>', myhtmlspecialchars($keyword) );
 		}
 		else
 		{ // There are affected comment witch corresponding status, but current user has no permission
diff -ru b2evolution.orig/blogs/inc/antispam/views/_antispam_ban.form.php b2evolution/blogs/inc/antispam/views/_antispam_ban.form.php
--- b2evolution.orig/blogs/inc/antispam/views/_antispam_ban.form.php	2012-04-22 17:00:31.026397793 +0200
+++ b2evolution/blogs/inc/antispam/views/_antispam_ban.form.php	2012-04-22 17:00:31.910419921 +0200
@@ -57,7 +57,7 @@
 	$res_affected_hits = $DB->get_results( $sql, ARRAY_A );
 	if( $DB->num_rows == 0 )
 	{ // No matching hits.
-		printf( '<p>'.T_('No <strong>log-hits</strong> match the keyword [%s].').'</p>', htmlspecialchars($keyword) );
+		printf( '<p>'.T_('No <strong>log-hits</strong> match the keyword [%s].').'</p>', myhtmlspecialchars($keyword) );
 	}
 	else
 	{
@@ -112,7 +112,7 @@
 	$res_affected_comments = $DB->get_results( $sql, OBJECT, 'Find matching comments' );
 	if( $DB->num_rows == 0 )
 	{ // No matching hits.
-		printf( '<p>'.T_('No <strong>comments</strong> match the keyword [%s].').'</p>', htmlspecialchars($keyword) );
+		printf( '<p>'.T_('No <strong>comments</strong> match the keyword [%s].').'</p>', myhtmlspecialchars($keyword) );
 	}
 	else
 	{ // create comment arrays
@@ -243,7 +243,7 @@
 	// Check if the string is already in the blacklist:
 	if( antispam_check($keyword) )
 	{ // Already there:
-		printf( '<p>'.T_('The keyword [%s] is <strong>already handled</strong> by the blacklist.').'</p>', htmlspecialchars($keyword) );
+		printf( '<p>'.T_('The keyword [%s] is <strong>already handled</strong> by the blacklist.').'</p>', myhtmlspecialchars($keyword) );
 	}
 	else
 	{ // Not in blacklist
@@ -251,7 +251,7 @@
 		<p>
 		<input type="checkbox" name="blacklist_locally" id="blacklist_locally_cb" value="1" checked="checked" />
 		<label for="blacklist_locally_cb">
-			<?php printf ( T_('<strong>Blacklist</strong> the keyword [%s] locally.'), htmlspecialchars($keyword) ) ?>
+			<?php printf ( T_('<strong>Blacklist</strong> the keyword [%s] locally.'), myhtmlspecialchars($keyword) ) ?>
 		</label>
 		</p>
 
@@ -262,7 +262,7 @@
 			<p>
 			<input type="checkbox" name="report" id="report_cb" value="1" checked="checked" />
 			<label for="report_cb">
-				<?php printf ( T_('<strong>Report</strong> the keyword [%s] as abuse to b2evolution.net.'), htmlspecialchars($keyword) ) ?>
+				<?php printf ( T_('<strong>Report</strong> the keyword [%s] as abuse to b2evolution.net.'), myhtmlspecialchars($keyword) ) ?>
 			</label>
 			[<a href="http://b2evolution.net/about/terms.html"><?php echo T_('Terms of service') ?></a>]
 			</p>
diff -ru b2evolution.orig/blogs/inc/antispam/views/_antispam_list.view.php b2evolution/blogs/inc/antispam/views/_antispam_list.view.php
--- b2evolution.orig/blogs/inc/antispam/views/_antispam_list.view.php	2012-04-22 17:00:31.026397793 +0200
+++ b2evolution/blogs/inc/antispam/views/_antispam_list.view.php	2012-04-22 17:00:31.910419921 +0200
@@ -113,7 +113,7 @@
 $Results->cols[] = array(
 						'th' => T_('Keyword'),
 						'order' => 'aspm_string',
-						'td' => '%htmlspecialchars(#aspm_string#)%',
+						'td' => '%myhtmlspecialchars(#aspm_string#)%',
 					);
 
 // Set columns:
diff -ru b2evolution.orig/blogs/inc/_blog_main.inc.php b2evolution/blogs/inc/_blog_main.inc.php
--- b2evolution.orig/blogs/inc/_blog_main.inc.php	2012-04-22 17:00:31.122400197 +0200
+++ b2evolution/blogs/inc/_blog_main.inc.php	2012-04-22 17:00:31.694414513 +0200
@@ -516,7 +516,7 @@
 	}
 	elseif( skin_exists( $skin ) && ! skin_installed( $skin ) )
 	{	// The requested skin is not a feed skin and exists in the file system, but isn't installed:
-		debug_die( sprintf( T_( 'The skin [%s] is not installed on this system.' ), htmlspecialchars( $skin ) ) );
+		debug_die( sprintf( T_( 'The skin [%s] is not installed on this system.' ), myhtmlspecialchars( $skin ) ) );
 	}
 	elseif( ! empty( $tempskin ) )
 	{ // By definition, we want to see the temporary skin (if we don't use feedburner... )
@@ -535,7 +535,7 @@
 if( !empty( $skin ) && !skin_exists( $skin ) )
 { // We want to use a skin, but it doesn't exist!
 	$err_msg = sprintf( T_('The skin [%s] set for blog [%s] does not exist. It must be properly set in the <a %s>blog properties</a> or properly overriden in a stub file.'),
-		htmlspecialchars($skin),
+		myhtmlspecialchars($skin),
 		$Blog->dget('shortname'),
 		'href="'.$admin_url.'?ctrl=coll_settings&amp;tab=skin&amp;blog='.$Blog->ID.'"' );
 	debug_die( $err_msg );
diff -ru b2evolution.orig/blogs/inc/chapters/views/_chapter_list.view.php b2evolution/blogs/inc/chapters/views/_chapter_list.view.php
--- b2evolution.orig/blogs/inc/chapters/views/_chapter_list.view.php	2012-04-22 17:00:31.026397793 +0200
+++ b2evolution/blogs/inc/chapters/views/_chapter_list.view.php	2012-04-22 17:00:31.906419821 +0200
@@ -106,7 +106,7 @@
 	}
 
 	$edit_url = regenerate_url( 'action,cat_ID', 'cat_ID='.$Chapter->ID.'&amp;action=edit' );
-	$r .= '<td><a href="'.htmlspecialchars($Chapter->get_permanent_url()).'">'.$Chapter->dget('urlname').'</a></td>';
+	$r .= '<td><a href="'.myhtmlspecialchars($Chapter->get_permanent_url()).'">'.$Chapter->dget('urlname').'</a></td>';
 
 	if( $Settings->get('chapter_ordering') == 'manual' )
 	{
diff -ru b2evolution.orig/blogs/inc/comments/_trackback.funcs.php b2evolution/blogs/inc/comments/_trackback.funcs.php
--- b2evolution.orig/blogs/inc/comments/_trackback.funcs.php	2012-04-22 17:00:31.006397293 +0200
+++ b2evolution/blogs/inc/comments/_trackback.funcs.php	2012-04-22 17:00:31.878419119 +0200
@@ -71,7 +71,7 @@
 {
 	global $app_name, $app_version, $Blog, $Messages;
 
-	$trackback_message = T_('Sending trackback to:').' '.htmlspecialchars($trackback_url).' ';
+	$trackback_message = T_('Sending trackback to:').' '.myhtmlspecialchars($trackback_url).' ';
 
 	$title = rawurlencode($title);
 	$excerpt = rawurlencode($excerpt);
diff -ru b2evolution.orig/blogs/inc/comments/views/_comment.form.php b2evolution/blogs/inc/comments/views/_comment.form.php
--- b2evolution.orig/blogs/inc/comments/views/_comment.form.php	2012-04-22 17:00:30.994396993 +0200
+++ b2evolution/blogs/inc/comments/views/_comment.form.php	2012-04-22 17:00:31.878419119 +0200
@@ -136,7 +136,7 @@
 	$content = $edited_Comment->content;
 	if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' )
 	{
-		// echo 'unBR:',htmlspecialchars(str_replace( ' ', '*', $content) );
+		// echo 'unBR:',myhtmlspecialchars(str_replace( ' ', '*', $content) );
 		$content = unautobrize($content);
 	}
 
diff -ru b2evolution.orig/blogs/inc/comments/views/_comments_sidebar.view.php b2evolution/blogs/inc/comments/views/_comments_sidebar.view.php
--- b2evolution.orig/blogs/inc/comments/views/_comments_sidebar.view.php	2012-04-22 17:00:30.994396993 +0200
+++ b2evolution/blogs/inc/comments/views/_comments_sidebar.view.php	2012-04-22 17:00:31.878419119 +0200
@@ -100,7 +100,7 @@
 
 	echo $Form->inputstart;
 	?>
-	<div><input type="text" name="s" size="20" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" /></div>
+	<div><input type="text" name="s" size="20" value="<?php echo myhtmlspecialchars($s) ?>" class="SearchField" /></div>
 	<?php
 	echo $Form->inputend;
 	?>
@@ -171,7 +171,7 @@
 
 	echo $Form->inputstart;
 	?>
-	<div><input type="text" name="author_url" size="20" value="<?php echo htmlspecialchars($author_url) ?>" class="SearchField" /></div>
+	<div><input type="text" name="author_url" size="20" value="<?php echo myhtmlspecialchars($author_url) ?>" class="SearchField" /></div>
 	<?php
 	echo $Form->inputend;
 	?>
diff -ru b2evolution.orig/blogs/inc/_core/_misc.funcs.php b2evolution/blogs/inc/_core/_misc.funcs.php
--- b2evolution.orig/blogs/inc/_core/_misc.funcs.php	2012-04-22 17:00:31.118400097 +0200
+++ b2evolution/blogs/inc/_core/_misc.funcs.php	2012-04-22 19:11:13.864643412 +0200
@@ -53,6 +53,16 @@
 
 
 /**
+ * Force charset encoding in htmlspecialchars
+ */
+function myhtmlspecialchars( $string, $flags = ENT_COMPAT )
+{
+	global $current_charset;
+	return htmlspecialchars ($string, $flags, $current_charset);
+}
+
+
+/**
  * Call a method for all modules in a row
  */
 function modules_call_method( $method_name )
@@ -261,7 +271,7 @@
 		case 'entityencoded':
 			// Special mode for RSS 0.92: apply renders and allow full HTML but escape it
 			$content = convert_chars($content, 'html');
-			$content = htmlspecialchars( $content, ENT_QUOTES );
+			$content = myhtmlspecialchars( $content, ENT_QUOTES );
 			break;
 
 		case 'htmlfeed':
@@ -288,7 +298,7 @@
 		case 'htmlspecialchars':
 		case 'formvalue':
 			// use as a form value: escapes &, quotes and < > but leaves code alone
-			$content = htmlspecialchars( $content, ENT_QUOTES );  // Handles &, ", ', < and >
+			$content = myhtmlspecialchars( $content, ENT_QUOTES );  // Handles &, ", ', < and >
 			break;
 
 		case 'xml':
@@ -1771,7 +1781,7 @@
 			var_dump($lvar); // includes "\n"; do not use var_export() because it does not detect recursion by design
 			$buffer = ob_get_contents();
 			ob_end_clean();
-			echo htmlspecialchars($buffer);
+			echo myhtmlspecialchars($buffer);
 
 			$count++;
 			if( $count < $func_num_args )
@@ -1914,7 +1924,7 @@
 							$args[] = 'Object('.get_class($l_arg).')';
 							break;
 						case 'resource':
-							$args[] = htmlspecialchars((string)$l_arg);
+							$args[] = myhtmlspecialchars((string)$l_arg);
 							break;
 						case 'boolean':
 							$args[] = $l_arg ? 'true' : 'false';
@@ -1928,13 +1938,13 @@
 			$call = "<strong>\n";
 			if( isset($l_trace['class']) )
 			{
-				$call .= htmlspecialchars($l_trace['class']);
+				$call .= myhtmlspecialchars($l_trace['class']);
 			}
 			if( isset($l_trace['type']) )
 			{
-				$call .= htmlspecialchars($l_trace['type']);
+				$call .= myhtmlspecialchars($l_trace['type']);
 			}
-			$call .= htmlspecialchars($l_trace['function'])."( </strong>\n";
+			$call .= myhtmlspecialchars($l_trace['function'])."( </strong>\n";
 			if( $args )
 			{
 				$call .= ' '.implode( ', ', $args ).' ';
@@ -2654,7 +2664,7 @@
 	// From has to go into headers
 	$headers['From'] = $from;
 
-	// echo 'sending email to: ['.htmlspecialchars($to).'] from ['.htmlspecialchars($from).']';
+	// echo 'sending email to: ['.myhtmlspecialchars($to).'] from ['.myhtmlspecialchars($from).']';
 
 	$subject = mail_encode_header_string($subject);
 
@@ -2686,19 +2696,19 @@
 	{	// We agree to die for debugging...
 		if( ! mail( $to, $subject, $message, $headerstring ) )
 		{
-			debug_die( 'Sending mail from &laquo;'.htmlspecialchars($from).'&raquo; to &laquo;'.htmlspecialchars($to).'&raquo;, Subject &laquo;'.htmlspecialchars($subject).'&raquo; FAILED.' );
+			debug_die( 'Sending mail from &laquo;'.myhtmlspecialchars($from).'&raquo; to &laquo;'.myhtmlspecialchars($to).'&raquo;, Subject &laquo;'.myhtmlspecialchars($subject).'&raquo; FAILED.' );
 		}
 	}
 	else
 	{	// Soft debugging only....
 		if( ! @mail( $to, $subject, $message, $headerstring ) )
 		{
-			$Debuglog->add( 'Sending mail from &laquo;'.htmlspecialchars($from).'&raquo; to &laquo;'.htmlspecialchars($to).'&raquo;, Subject &laquo;'.htmlspecialchars($subject).'&raquo; FAILED.', 'error' );
+			$Debuglog->add( 'Sending mail from &laquo;'.myhtmlspecialchars($from).'&raquo; to &laquo;'.myhtmlspecialchars($to).'&raquo;, Subject &laquo;'.myhtmlspecialchars($subject).'&raquo; FAILED.', 'error' );
 			return false;
 		}
 	}
 
-	$Debuglog->add( 'Sent mail from &laquo;'.htmlspecialchars($from).'&raquo; to &laquo;'.htmlspecialchars($to).'&raquo;, Subject &laquo;'.htmlspecialchars($subject).'&raquo;.' );
+	$Debuglog->add( 'Sent mail from &laquo;'.myhtmlspecialchars($from).'&raquo; to &laquo;'.myhtmlspecialchars($to).'&raquo;, Subject &laquo;'.myhtmlspecialchars($subject).'&raquo;.' );
 	return true;
 }
 
@@ -3294,7 +3304,7 @@
 		array(  '\\', '"', "'" ),
 		array( '\\\\', '\"', "\'" ),
 		$s );
-	return htmlspecialchars($r, ENT_QUOTES);
+	return myhtmlspecialchars($r, ENT_QUOTES);
 }
 
 
@@ -3445,7 +3455,7 @@
 
 		if( $format_to_output )
 		{
-			$r .= ' '.$l_attr.'="'.htmlspecialchars($l_value).'"';
+			$r .= ' '.$l_attr.'="'.myhtmlspecialchars($l_value).'"';
 		}
 		else
 		{
@@ -4328,4 +4338,4 @@
 /*
  * $Log: _misc.funcs.php,v $
  */
-?>
\ Pas de fin de ligne à la fin du fichier
+?>
diff -ru b2evolution.orig/blogs/inc/_core/_param.funcs.php b2evolution/blogs/inc/_core/_param.funcs.php
--- b2evolution.orig/blogs/inc/_core/_param.funcs.php	2012-04-22 17:00:31.110399897 +0200
+++ b2evolution/blogs/inc/_core/_param.funcs.php	2012-04-22 17:00:31.966421322 +0200
@@ -1952,7 +1952,7 @@
 		{
 			$errmsg = ($context == 'commenting')
 				? T_('Illegal content found (spam?).')
-				: sprintf( T_('Illegal content found: blacklisted word &laquo;%s&raquo;.'), htmlspecialchars($block) );
+				: sprintf( T_('Illegal content found: blacklisted word &laquo;%s&raquo;.'), myhtmlspecialchars($block) );
 		}
 
 		$Messages->add(	$errmsg, 'error' );
@@ -1991,7 +1991,7 @@
 
 		if( $context == 'commenting' )
 		{	// DEPRECATED but still...
-			// echo 'allowed tags:',htmlspecialchars($comment_allowed_tags);
+			// echo 'allowed tags:',myhtmlspecialchars($comment_allowed_tags);
 			$content = strip_tags( $content, $comment_allowed_tags );
 		}
 
@@ -2006,7 +2006,7 @@
 		if( ! $allow_css_tweaks
 			&& preg_match( '#\s((style|class|id)\s*=)#i', $check, $matches) )
 		{
-			$Messages->add( T_('Illegal CSS markup found: ').htmlspecialchars($matches[1]), 'error' );
+			$Messages->add( T_('Illegal CSS markup found: ').myhtmlspecialchars($matches[1]), 'error' );
 			$error = true;
 		}
 
@@ -2017,7 +2017,7 @@
 				// action=, background=, cite=, classid=, codebase=, data=, href=, longdesc=, profile=, src=, usemap=
 				|| preg_match( '#=["\'\s]*((javascript|vbscript|about):)#i', $check, $matches ) ) )
 		{
-			$Messages->add( T_('Illegal javascript markup found: ').htmlspecialchars($matches[1]), 'error' );
+			$Messages->add( T_('Illegal javascript markup found: ').myhtmlspecialchars($matches[1]), 'error' );
 			$error = true;
 		}
 
@@ -2025,7 +2025,7 @@
 		if( ! $allow_iframes
 			&& preg_match( '~( < \s* //? \s* (frame|iframe) )~xi', $check, $matches) )
 		{
-			$Messages->add( T_('Illegal frame markup found: ').htmlspecialchars($matches[1]), 'error' );
+			$Messages->add( T_('Illegal frame markup found: ').myhtmlspecialchars($matches[1]), 'error' );
 			$error = true;
 		}
 
@@ -2033,7 +2033,7 @@
 		if( ! $allow_objects
 			&& preg_match( '~( < \s* //? \s* (applet|object|param|embed) )~xi', $check, $matches) )
 		{
-			$Messages->add( T_('Illegal object markup found: ').htmlspecialchars($matches[1]), 'error' );
+			$Messages->add( T_('Illegal object markup found: ').myhtmlspecialchars($matches[1]), 'error' );
 			$error = true;
 		}
 
diff -ru b2evolution.orig/blogs/inc/_core/_template.funcs.php b2evolution/blogs/inc/_core/_template.funcs.php
--- b2evolution.orig/blogs/inc/_core/_template.funcs.php	2012-04-22 17:00:31.106399797 +0200
+++ b2evolution/blogs/inc/_core/_template.funcs.php	2012-04-22 17:00:31.966421322 +0200
@@ -223,7 +223,7 @@
 
 	if( headers_sent() )
 	{
-		debug_die('Headers have already been sent. Cannot <a href="'.htmlspecialchars($redirect_to).'">redirect</a>.');
+		debug_die('Headers have already been sent. Cannot <a href="'.myhtmlspecialchars($redirect_to).'">redirect</a>.');
 	}
 	header( 'Location: '.$redirect_to, true, $http_response_code ); // explictly setting the status is required for (fast)cgi
 	exit(0);
diff -ru b2evolution.orig/blogs/inc/_core/_url.funcs.php b2evolution/blogs/inc/_core/_url.funcs.php
--- b2evolution.orig/blogs/inc/_core/_url.funcs.php	2012-04-22 17:00:31.102399696 +0200
+++ b2evolution/blogs/inc/_core/_url.funcs.php	2012-04-22 17:00:31.962421221 +0200
@@ -72,7 +72,7 @@
 				$scheme = 'mailto:';
 				$Debuglog->add( 'URI scheme &laquo;'.$scheme.'&raquo; not allowed!', 'error' );
 				return $verbose
-					? sprintf( T_('URI scheme "%s" not allowed.'), htmlspecialchars($scheme) )
+					? sprintf( T_('URI scheme "%s" not allowed.'), myhtmlspecialchars($scheme) )
 					: T_('URI scheme not allowed.');
 			}
 
@@ -80,13 +80,13 @@
 			if( ! $match )
 			{
 				return $verbose
-					? sprintf( T_('Invalid email link: %s.'), htmlspecialchars($url) )
+					? sprintf( T_('Invalid email link: %s.'), myhtmlspecialchars($url) )
 					: T_('Invalid email link.');
 			}
       elseif( ! is_email($match[2]) )
 			{
 				return $verbose
-					? sprintf( T_('Supplied email address (%s) is invalid.'), htmlspecialchars($match[2]) )
+					? sprintf( T_('Supplied email address (%s) is invalid.'), myhtmlspecialchars($match[2]) )
 					: T_('Invalid email address.');
 			}
 		}
@@ -97,7 +97,7 @@
 				$scheme = 'clsid:';
 				$Debuglog->add( 'URI scheme &laquo;'.$scheme.'&raquo; not allowed!', 'error' );
 				return $verbose
-					? sprintf( T_('URI scheme "%s" not allowed.'), htmlspecialchars($scheme) )
+					? sprintf( T_('URI scheme "%s" not allowed.'), myhtmlspecialchars($scheme) )
 					: T_('URI scheme not allowed.');
 			}
 
@@ -114,7 +114,7 @@
 				$scheme = 'javascript:';
 				$Debuglog->add( 'URI scheme &laquo;'.$scheme.'&raquo; not allowed!', 'error' );
 				return $verbose
-					? sprintf( T_('URI scheme "%s" not allowed.'), htmlspecialchars($scheme) )
+					? sprintf( T_('URI scheme "%s" not allowed.'), myhtmlspecialchars($scheme) )
 					: T_('URI scheme not allowed.');
 			}
 
@@ -140,7 +140,7 @@
 			{ // Cannot validate URL structure
 				$Debuglog->add( 'URL &laquo;'.$url.'&raquo; does not match url pattern!', 'error' );
 				return $verbose
-					? sprintf( T_('Invalid URL format (%s).'), htmlspecialchars($url) )
+					? sprintf( T_('Invalid URL format (%s).'), myhtmlspecialchars($url) )
 					: T_('Invalid URL format.');
 			}
 
@@ -149,7 +149,7 @@
 			{ // Scheme not allowed
 				$Debuglog->add( 'URI scheme &laquo;'.$scheme.'&raquo; not allowed!', 'error' );
 				return $verbose
-					? sprintf( T_('URI scheme "%s" not allowed.'), htmlspecialchars($scheme) )
+					? sprintf( T_('URI scheme "%s" not allowed.'), myhtmlspecialchars($scheme) )
 					: T_('URI scheme not allowed.');
 			}
 		}
@@ -158,14 +158,14 @@
 	{ // URL is relative..
 		if( $context == 'commenting' )
 		{	// We do not allow relative URLs in comments
-			return $verbose ? sprintf( T_('URL "%s" must be absolute.'), htmlspecialchars($url) ) : T_('URL must be absolute.');
+			return $verbose ? sprintf( T_('URL "%s" must be absolute.'), myhtmlspecialchars($url) ) : T_('URL must be absolute.');
 		}
 
 		$char = substr($url, 0, 1);
 		if( $char != '/' && $char != '#' )
 		{ // must start with a slash or hash (for HTML anchors to the same page)
 			return $verbose
-				? sprintf( T_('URL "%s" must be a full path starting with "/" or an anchor starting with "#".'), htmlspecialchars($url) )
+				? sprintf( T_('URL "%s" must be a full path starting with "/" or an anchor starting with "#".'), myhtmlspecialchars($url) )
 				: T_('URL must be a full path starting with "/" or an anchor starting with "#".');
 		}
 	}
@@ -176,7 +176,7 @@
 		if( $block = antispam_check($url) )
 		{
 			return $verbose
-				? sprintf( T_('URL "%s" not allowed: blacklisted word "%s".'), htmlspecialchars($url), $block )
+				? sprintf( T_('URL "%s" not allowed: blacklisted word "%s".'), myhtmlspecialchars($url), $block )
 				: T_('URL not allowed');
 		}
 	}
@@ -728,11 +728,11 @@
 {
 	if( !empty($max_length) && evo_strlen($url) > $max_length )
 	{
-		$disp_url = htmlspecialchars(substr( $url, 0, $max_length-1 )).'&hellip;';
+		$disp_url = myhtmlspecialchars(substr( $url, 0, $max_length-1 )).'&hellip;';
 	}
 	else
 	{
-		$disp_url = htmlspecialchars($url);
+		$disp_url = myhtmlspecialchars($url);
 	}
 	echo '<a href="'.$url.'">'.$disp_url.'</a>';
 }
diff -ru b2evolution.orig/blogs/inc/_ext/xmlrpc/_xmlrpc.inc.php b2evolution/blogs/inc/_ext/xmlrpc/_xmlrpc.inc.php
--- b2evolution.orig/blogs/inc/_ext/xmlrpc/_xmlrpc.inc.php	2012-04-22 17:00:31.042398195 +0200
+++ b2evolution/blogs/inc/_ext/xmlrpc/_xmlrpc.inc.php	2012-04-22 19:07:07.242485637 +0200
@@ -1922,7 +1922,7 @@
 				// error response
 				$this->errno = $fcode;
 				$this->errstr = $fstr;
-				//$this->errstr = htmlspecialchars($fstr); // XXX: encoding probably shouldn't be done here; fix later.
+				//$this->errstr = myhtmlspecialchars($fstr); // XXX: encoding probably shouldn't be done here; fix later.
 			}
 			else
 			{
@@ -2638,7 +2638,7 @@
 					print "<PRE>---PARSED---\n";
 					// somehow htmlentities chokes on var_export, and some full html string...
 					//print htmlentitites(var_export($GLOBALS['_xh']['value'], true));
-					print htmlspecialchars(var_export($GLOBALS['_xh']['value'], true));
+					print myhtmlspecialchars(var_export($GLOBALS['_xh']['value'], true));
 					print "\n---END---</PRE>";
 				}
 
diff -ru b2evolution.orig/blogs/inc/files/model/_file.class.php b2evolution/blogs/inc/files/model/_file.class.php
--- b2evolution.orig/blogs/inc/files/model/_file.class.php	2012-04-22 17:00:30.982396693 +0200
+++ b2evolution/blogs/inc/files/model/_file.class.php	2012-04-22 17:00:31.858418619 +0200
@@ -1054,11 +1054,11 @@
 
 				if( !empty($image_link_title) )
 				{
-					$a .= ' title="'.htmlspecialchars($image_link_title).'"';
+					$a .= ' title="'.myhtmlspecialchars($image_link_title).'"';
 				}
 				if( !empty($image_link_rel) )
 				{
-					$a .= ' rel="'.htmlspecialchars($image_link_rel).'"';
+					$a .= ' rel="'.myhtmlspecialchars($image_link_rel).'"';
 				}
 				$img = $a.'>'.$img.'</a>';
 			}
@@ -2119,7 +2119,7 @@
 
 			default:
 				// not defined restriction
-				debug_die ( 'unhandled restriction:' . htmlspecialchars ( $restriction['table'] ) );
+				debug_die ( 'unhandled restriction:' . myhtmlspecialchars ( $restriction['table'] ) );
 		}
 
 		$result_link = '';
diff -ru b2evolution.orig/blogs/inc/items/items.ctrl.php b2evolution/blogs/inc/items/items.ctrl.php
--- b2evolution.orig/blogs/inc/items/items.ctrl.php	2012-04-22 17:00:30.958396091 +0200
+++ b2evolution/blogs/inc/items/items.ctrl.php	2012-04-22 17:00:31.810417417 +0200
@@ -206,7 +206,7 @@
 		break;
 
 	default:
-		debug_die( 'unhandled action 1:'.htmlspecialchars($action) );
+		debug_die( 'unhandled action 1:'.myhtmlspecialchars($action) );
 }
 
 $AdminUI->breadcrumbpath_init();
@@ -940,7 +940,7 @@
 		break;
 
 	default:
-		debug_die( 'unhandled action 2: '.htmlspecialchars($action) );
+		debug_die( 'unhandled action 2: '.myhtmlspecialchars($action) );
 }
 
 
diff -ru b2evolution.orig/blogs/inc/items/model/_item.class.php b2evolution/blogs/inc/items/model/_item.class.php
--- b2evolution.orig/blogs/inc/items/model/_item.class.php	2012-04-22 17:00:30.954395991 +0200
+++ b2evolution/blogs/inc/items/model/_item.class.php	2012-04-22 17:00:31.826417817 +0200
@@ -3135,7 +3135,7 @@
 				}
 				else
 				{
-					echo htmlspecialchars($tag);
+					echo myhtmlspecialchars($tag);
 				}
 			}
 
diff -ru b2evolution.orig/blogs/inc/items/model/_item.funcs.php b2evolution/blogs/inc/items/model/_item.funcs.php
--- b2evolution.orig/blogs/inc/items/model/_item.funcs.php	2012-04-22 17:00:30.946395791 +0200
+++ b2evolution/blogs/inc/items/model/_item.funcs.php	2012-04-22 17:00:31.830417917 +0200
@@ -775,8 +775,8 @@
 					? 'sel_extracat_'.$cat_ID
 					: 'sel_maincat_'.$cat_ID ).'"'
 				.' style="padding-left:'.($level-1).'em;">'
-				.htmlspecialchars($thisChapter->name).'</label>'
-				.' <a href="'.htmlspecialchars($thisChapter->get_permanent_url()).'" title="'.htmlspecialchars(T_('View category in blog.')).'">'
+				.myhtmlspecialchars($thisChapter->name).'</label>'
+				.' <a href="'.myhtmlspecialchars($thisChapter->get_permanent_url()).'" title="'.myhtmlspecialchars(T_('View category in blog.')).'">'
 				.'&nbsp;&raquo;&nbsp; ' // TODO: dh> provide an icon instead? // fp> maybe the A(dmin)/B(log) icon from the toolbar? And also use it for permalinks to posts?
 				.'</a></td>'
 				.'<!--[if IE 7]><td width="1"><!-- for IE7 --></td><![endif]--></tr>'
@@ -1953,4 +1953,4 @@
 /*
  * $Log: _item.funcs.php,v $
  */
-?>
\ Pas de fin de ligne à la fin du fichier
+?>
diff -ru b2evolution.orig/blogs/inc/items/model/_itemlight.class.php b2evolution/blogs/inc/items/model/_itemlight.class.php
--- b2evolution.orig/blogs/inc/items/model/_itemlight.class.php	2012-04-22 17:00:30.942395691 +0200
+++ b2evolution/blogs/inc/items/model/_itemlight.class.php	2012-04-22 17:00:31.834418018 +0200
@@ -395,7 +395,7 @@
 			if( $params['link_categories'] )
 			{ // we want to display links
 				$lBlog = & $Chapter->get_Blog();
-				$cat_name = '<a href="'.$Chapter->get_permanent_url().'" title="'.htmlspecialchars($params['link_title']).'">'.$cat_name.'</a>';
+				$cat_name = '<a href="'.$Chapter->get_permanent_url().'" title="'.myhtmlspecialchars($params['link_title']).'">'.$cat_name.'</a>';
 			}
 
 			if( $Chapter->ID == $this->main_cat_ID )
diff -ru b2evolution.orig/blogs/inc/items/model/_itemlist.class.php b2evolution/blogs/inc/items/model/_itemlist.class.php
--- b2evolution.orig/blogs/inc/items/model/_itemlist.class.php	2012-04-22 17:00:30.942395691 +0200
+++ b2evolution/blogs/inc/items/model/_itemlist.class.php	2012-04-22 17:00:31.830417917 +0200
@@ -701,7 +701,7 @@
 				break;
 
 			default:
-				echo 'WARNING: unhandled sorting: '.htmlspecialchars( $orderby_array[0] );
+				echo 'WARNING: unhandled sorting: '.myhtmlspecialchars( $orderby_array[0] );
 		}
 
 		// GET DATA ROWS:
diff -ru b2evolution.orig/blogs/inc/items/model/_itemlistlight.class.php b2evolution/blogs/inc/items/model/_itemlistlight.class.php
--- b2evolution.orig/blogs/inc/items/model/_itemlistlight.class.php	2012-04-22 17:00:30.942395691 +0200
+++ b2evolution/blogs/inc/items/model/_itemlistlight.class.php	2012-04-22 17:00:31.838418119 +0200
@@ -1039,7 +1039,7 @@
 				{
 					if( $tmp_Author = $UserCache->get_by_ID($author_ID, false) ) 
 					{
-						$author_names[] = htmlspecialchars($tmp_Author->get_preferred_name());
+						$author_names[] = myhtmlspecialchars($tmp_Author->get_preferred_name());
 					}
 				}
 				$authors = implode(', ', $author_names);
diff -ru b2evolution.orig/blogs/inc/items/views/_item_expert.form.php b2evolution/blogs/inc/items/views/_item_expert.form.php
--- b2evolution.orig/blogs/inc/items/views/_item_expert.form.php	2012-04-22 17:00:30.934395491 +0200
+++ b2evolution/blogs/inc/items/views/_item_expert.form.php	2012-04-22 17:00:31.814417517 +0200
@@ -256,7 +256,7 @@
 	<div id="itemform_post_excerpt" class="edit_fieldgroup">
 		<label for="post_excerpt"><strong><?php echo T_('Excerpt') ?>:</strong>
 		<span class="notes"><?php echo T_('(for XML feeds)') ?></span></label><br />
-		<textarea name="post_excerpt" rows="2" cols="25" class="large" id="post_excerpt"><?php echo htmlspecialchars($edited_Item_excerpt) ?></textarea>
+		<textarea name="post_excerpt" rows="2" cols="25" class="large" id="post_excerpt"><?php echo myhtmlspecialchars($edited_Item_excerpt) ?></textarea>
 	</div>
 
 	<?php
diff -ru b2evolution.orig/blogs/inc/items/views/_item_links.view.php b2evolution/blogs/inc/items/views/_item_links.view.php
--- b2evolution.orig/blogs/inc/items/views/_item_links.view.php	2012-04-22 17:00:30.934395491 +0200
+++ b2evolution/blogs/inc/items/views/_item_links.view.php	2012-04-22 17:00:31.814417517 +0200
@@ -231,7 +231,7 @@
 	foreach($params as $param)
 	{
 		list($k, $v) = explode('=', $param);
-		$r .= '<input type="hidden" name="'.htmlspecialchars($k).'" value="'.htmlspecialchars($v).'" />';
+		$r .= '<input type="hidden" name="'.myhtmlspecialchars($k).'" value="'.myhtmlspecialchars($v).'" />';
 	}
 	$r .= '<input class="SaveButton" type="submit" value="&raquo;" />';
 	$r .= '</noscript>';
diff -ru b2evolution.orig/blogs/inc/items/views/_item_list_sidebar.view.php b2evolution/blogs/inc/items/views/_item_list_sidebar.view.php
--- b2evolution.orig/blogs/inc/items/views/_item_list_sidebar.view.php	2012-04-22 17:00:30.930395391 +0200
+++ b2evolution/blogs/inc/items/views/_item_list_sidebar.view.php	2012-04-22 17:00:31.810417417 +0200
@@ -120,7 +120,7 @@
 
 		echo $Form->inputstart;
 		?>
-		<div><input type="text" name="s" size="20" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" /></div>
+		<div><input type="text" name="s" size="20" value="<?php echo myhtmlspecialchars($s) ?>" class="SearchField" /></div>
 		<?php
 		echo $Form->inputend;
 		// echo T_('Words').' : ';
diff -ru b2evolution.orig/blogs/inc/items/views/_item_mass_edit.view.php b2evolution/blogs/inc/items/views/_item_mass_edit.view.php
--- b2evolution.orig/blogs/inc/items/views/_item_mass_edit.view.php	2012-04-22 17:00:30.930395391 +0200
+++ b2evolution/blogs/inc/items/views/_item_mass_edit.view.php	2012-04-22 17:00:31.814417517 +0200
@@ -71,7 +71,7 @@
 	
 	$Form->text( 'mass_title_'.$Item->ID , $Item->get( 'title'), 70, T_('Title'), '', 255 );
 	$Form->text( 'mass_urltitle_'.$Item->ID, $Item->get( 'urltitle'), 70, T_('URL title "slug"'), '', 255 );
-	$Form->text( 'mass_titletag_'.$Item->ID, $Item->get( 'titletag'), 70, T_( htmlspecialchars('<title> tag') ), '', 255 );
+	$Form->text( 'mass_titletag_'.$Item->ID, $Item->get( 'titletag'), 70, T_( myhtmlspecialchars('<title> tag') ), '', 255 );
 
 	$Form->end_fieldset();
 }
diff -ru b2evolution.orig/blogs/inc/locales/_locale.funcs.php b2evolution/blogs/inc/locales/_locale.funcs.php
--- b2evolution.orig/blogs/inc/locales/_locale.funcs.php	2012-04-22 17:00:30.926395291 +0200
+++ b2evolution/blogs/inc/locales/_locale.funcs.php	2012-04-22 17:00:31.806417317 +0200
@@ -218,7 +218,7 @@
 		}
 		else
 		{
-			$Debuglog->add(sprintf('Warning: evo_charset not set to translate "%s"', htmlspecialchars($string)), 'locale');
+			$Debuglog->add(sprintf('Warning: evo_charset not set to translate "%s"', myhtmlspecialchars($string)), 'locale');
 		}
 
 		if( $params['for_helper'] )
diff -ru b2evolution.orig/blogs/inc/plugins/model/_plugins.class.php b2evolution/blogs/inc/plugins/model/_plugins.class.php
--- b2evolution.orig/blogs/inc/plugins/model/_plugins.class.php	2012-04-22 17:00:30.906394791 +0200
+++ b2evolution/blogs/inc/plugins/model/_plugins.class.php	2012-04-22 17:00:31.782416717 +0200
@@ -1218,7 +1218,7 @@
 			{
 				$debug_params['pass_md5'] = '-hidden-';
 			}
-			$Debuglog->add( 'Calling '.$Plugin->classname.'(#'.$Plugin->ID.')->'.$method.'( '.htmlspecialchars(var_export( $debug_params, true )).' )', 'plugins' );
+			$Debuglog->add( 'Calling '.$Plugin->classname.'(#'.$Plugin->ID.')->'.$method.'( '.myhtmlspecialchars(var_export( $debug_params, true )).' )', 'plugins' );
 			*/
 			$Debuglog->add( 'Calling '.$Plugin->classname.'(#'.$Plugin->ID.')->'.$method.'( )', 'plugins' );
 		}
diff -ru b2evolution.orig/blogs/inc/sessions/views/_stats_robots.view.php b2evolution/blogs/inc/sessions/views/_stats_robots.view.php
--- b2evolution.orig/blogs/inc/sessions/views/_stats_robots.view.php	2012-04-22 17:00:30.878394089 +0200
+++ b2evolution/blogs/inc/sessions/views/_stats_robots.view.php	2012-04-22 17:00:31.754416015 +0200
@@ -126,20 +126,20 @@
 {
 	global $user_agents;
 
-	$html_signature = htmlspecialchars( $agnt_signature );
+	$html_signature = myhtmlspecialchars( $agnt_signature );
 	$format = '<span title="'.$html_signature.'">%s</span>';
 
 	foreach ($user_agents as $curr_user_agent)
 	{
 		if( strpos($agnt_signature, $curr_user_agent[1]) !== false )
 		{
-			return sprintf( $format, htmlspecialchars($curr_user_agent[2]) );
+			return sprintf( $format, myhtmlspecialchars($curr_user_agent[2]) );
 		}
 	}
 
 	if( ( $browscap = @get_browser( $agnt_signature ) ) && $browscap->browser != 'Default Browser' )
 	{
-		return sprintf( $format, htmlspecialchars( $browscap->browser ) );
+		return sprintf( $format, myhtmlspecialchars( $browscap->browser ) );
 	}
 
 	return $html_signature;
diff -ru b2evolution.orig/blogs/inc/slugs/model/_slug.class.php b2evolution/blogs/inc/slugs/model/_slug.class.php
--- b2evolution.orig/blogs/inc/slugs/model/_slug.class.php	2012-04-22 17:00:30.866393789 +0200
+++ b2evolution/blogs/inc/slugs/model/_slug.class.php	2012-04-22 17:00:31.746415815 +0200
@@ -250,7 +250,7 @@
 
 			default:
 				// not defined restriction
-				debug_die('Slug::get_object: Unhandled object type: '.htmlspecialchars($this->type));
+				debug_die('Slug::get_object: Unhandled object type: '.myhtmlspecialchars($this->type));
 		}
 	}
 
diff -ru b2evolution.orig/blogs/inc/tools/mtimport.ctrl.php b2evolution/blogs/inc/tools/mtimport.ctrl.php
--- b2evolution.orig/blogs/inc/tools/mtimport.ctrl.php	2012-04-22 17:00:30.862393689 +0200
+++ b2evolution/blogs/inc/tools/mtimport.ctrl.php	2012-04-22 17:00:31.738415615 +0200
@@ -443,7 +443,7 @@
 		<p>Please note:</p>
 		<ul>
 			<li>b2evolution does not support excerpts yet.
-			So, we will import them in front of the body with "<?php echo htmlspecialchars('<!--more-->< !--noteaser-->') ?>" tags,
+			So, we will import them in front of the body with "<?php echo myhtmlspecialchars('<!--more-->< !--noteaser-->') ?>" tags,
 			but only if there is no extended body for the post. In that case we'll use the extended body appended with the &lt;!--more--&gt; tag to the body - excerpts are lost then (but you'll get a note about it).
 			</li>
 		</ul>
@@ -725,7 +725,7 @@
 				if( !empty($excerpt) )
 				{
 					$message .=	'<li><span style="color:red">Excerpt discarded because of existing extended body:</span>
-					<blockquote>'.htmlspecialchars($excerpt).'</blockquote></li>';
+					<blockquote>'.myhtmlspecialchars($excerpt).'</blockquote></li>';
 				}
 				$post_content = $body."\n<!--more-->\n".$extended;
 			}
@@ -996,8 +996,8 @@
 
 					if( $post_content != $old_content )
 					{
-						$message .= '<li><p style="color:darkblue;border:1px dashed orange;">'.htmlspecialchars($old_content).'</p>
-						html-converted to: <p style="color:darkblue;border:1px dashed orange;">'.htmlspecialchars($post_content).'</p></li>';
+						$message .= '<li><p style="color:darkblue;border:1px dashed orange;">'.myhtmlspecialchars($old_content).'</p>
+						html-converted to: <p style="color:darkblue;border:1px dashed orange;">'.myhtmlspecialchars($post_content).'</p></li>';
 					}
 				}
 
@@ -1010,8 +1010,8 @@
 					}
 					if( $post_content != $old_content )
 					{
-						echo '<p style="color:darkblue;border:1px dashed orange;">'.htmlspecialchars($old_content).'</p>
-						converted img-links to: <p style="color:darkblue;border:1px dashed orange;">'.htmlspecialchars($post_content).'</p>';
+						echo '<p style="color:darkblue;border:1px dashed orange;">'.myhtmlspecialchars($old_content).'</p>
+						converted img-links to: <p style="color:darkblue;border:1px dashed orange;">'.myhtmlspecialchars($post_content).'</p>';
 					}
 				}*/
 
@@ -1300,7 +1300,7 @@
 					echo ' checked="checked"';
 				echo ' />';
 			}
-			echo ' '.htmlspecialchars(get_catname($cat_ID));
+			echo ' '.myhtmlspecialchars(get_catname($cat_ID));
 		}
 
 		function import_cat_select_after_each( $cat_ID, $level )
diff -ru b2evolution.orig/blogs/inc/widgets/widgets/_coll_search_form.widget.php b2evolution/blogs/inc/widgets/widgets/_coll_search_form.widget.php
--- b2evolution.orig/blogs/inc/widgets/widgets/_coll_search_form.widget.php	2012-04-22 17:00:30.826392787 +0200
+++ b2evolution/blogs/inc/widgets/widgets/_coll_search_form.widget.php	2012-04-22 17:00:31.706414815 +0200
@@ -132,7 +132,7 @@
 			echo '<div class="compact_search_form">';
 		}
 		$s = get_param( 's' );
-		echo '<input type="text" name="s" size="25" value="'.htmlspecialchars($s).'" class="search_field SearchField" />';
+		echo '<input type="text" name="s" size="25" value="'.myhtmlspecialchars($s).'" class="search_field SearchField" />';
 
 		if( $this->disp_params[ 'disp_search_options' ] )
 		{
diff -ru b2evolution.orig/blogs/inc/widgets/widgets/_free_html.widget.php b2evolution/blogs/inc/widgets/widgets/_free_html.widget.php
--- b2evolution.orig/blogs/inc/widgets/widgets/_free_html.widget.php	2012-04-22 17:00:30.826392787 +0200
+++ b2evolution/blogs/inc/widgets/widgets/_free_html.widget.php	2012-04-22 19:11:43.485381556 +0200
@@ -136,4 +136,4 @@
 /*
  * $Log: _free_html.widget.php,v $
  */
-?>
\ Pas de fin de ligne à la fin du fichier
+?>
diff -ru b2evolution.orig/blogs/inc/xhtml_validator/_xhtml_validator.class.php b2evolution/blogs/inc/xhtml_validator/_xhtml_validator.class.php
--- b2evolution.orig/blogs/inc/xhtml_validator/_xhtml_validator.class.php	2012-04-22 17:00:30.822392687 +0200
+++ b2evolution/blogs/inc/xhtml_validator/_xhtml_validator.class.php	2012-04-22 17:00:31.702414715 +0200
@@ -217,7 +217,7 @@
 					break;
 			}
 			$pos = xml_get_current_byte_index($this->parser);
-			$xml_error_string .= ' near <code>'.htmlspecialchars( evo_substr( $xhtml, $this->last_checked_pos, $pos-$this->last_checked_pos+20 ) ).'</code>';
+			$xml_error_string .= ' near <code>'.myhtmlspecialchars( evo_substr( $xhtml, $this->last_checked_pos, $pos-$this->last_checked_pos+20 ) ).'</code>';
 
 			$this->html_error( T_('Parser error: ').$xml_error_string );
 		}
diff -ru b2evolution.orig/blogs/plugins/_smilies.plugin.php b2evolution/blogs/plugins/_smilies.plugin.php
--- b2evolution.orig/blogs/plugins/_smilies.plugin.php	2012-04-22 17:00:30.566386279 +0200
+++ b2evolution/blogs/plugins/_smilies.plugin.php	2012-04-22 17:00:31.354406003 +0200
@@ -303,8 +303,8 @@
 	{
 		$attribs = array(
 			'src' => $smiley['image'],
-			'title' => htmlspecialchars($smiley['code']),
-			'alt' => htmlspecialchars($smiley['code']),
+			'title' => myhtmlspecialchars($smiley['code']),
+			'alt' => myhtmlspecialchars($smiley['code']),
 			'class' => 'middle',
 			);
 
diff -ru b2evolution.orig/blogs/plugins/tinymce_plugin/_tinymce.plugin.php b2evolution/blogs/plugins/tinymce_plugin/_tinymce.plugin.php
--- b2evolution.orig/blogs/plugins/tinymce_plugin/_tinymce.plugin.php	2012-04-22 17:00:30.558386079 +0200
+++ b2evolution/blogs/plugins/tinymce_plugin/_tinymce.plugin.php	2012-04-22 17:00:31.362406203 +0200
@@ -287,7 +287,7 @@
 			type="button"
 			value="WYSIWYG"
 			style="display:none"
-			title="<?php echo htmlspecialchars($this->T_('Toggle between WYSIWYG and plain HTML editor')); ?>" />
+			title="<?php echo myhtmlspecialchars($this->T_('Toggle between WYSIWYG and plain HTML editor')); ?>" />
 
 		<script type="text/javascript">
 			jQuery("#tinymce_plugin_toggle_button").click( function() {
@@ -335,7 +335,7 @@
 			// Load TinyMCE Javascript source file:
 			// This cannot be done through AJAX, since there appear to be scope problems on init then (TinyMCE problem?! - "u not defined").
 			// Anyway, not using AJAX to fetch the file makes it more cachable anyway.
-			echo '<script type="text/javascript" src="'.htmlspecialchars($this->get_tinymce_src_url()).'"></script>';
+			echo '<script type="text/javascript" src="'.myhtmlspecialchars($this->get_tinymce_src_url()).'"></script>';
 			?>
 
 			<script type="text/javascript">
diff -ru b2evolution.orig/blogs/plugins/_wacko.plugin.php b2evolution/blogs/plugins/_wacko.plugin.php
--- b2evolution.orig/blogs/plugins/_wacko.plugin.php	2012-04-22 17:00:30.566386279 +0200
+++ b2evolution/blogs/plugins/_wacko.plugin.php	2012-04-22 17:00:31.354406003 +0200
@@ -62,7 +62,7 @@
 			'$1<h2>$2</h2>',
 			'<hr />',
 			'\'<div class="codeblock"><pre><code>\'.
-			htmlspecialchars(stripslashes(\'$2\'),ENT_NOQUOTES).
+			myhtmlspecialchars(stripslashes(\'$2\'),ENT_NOQUOTES).
 			\'</code></pre></div>\''
 		);
 
diff -ru b2evolution.orig/blogs/skins/basic/_item_comment_form.inc.php b2evolution/blogs/skins/basic/_item_comment_form.inc.php
--- b2evolution.orig/blogs/skins/basic/_item_comment_form.inc.php	2012-04-22 17:00:30.374381475 +0200
+++ b2evolution/blogs/skins/basic/_item_comment_form.inc.php	2012-04-22 17:00:31.234403000 +0200
@@ -24,7 +24,7 @@
 	$comment_author = isset($_COOKIE[$cookie_name]) ? trim($_COOKIE[$cookie_name]) : '';
 	$comment_author_email = isset($_COOKIE[$cookie_email]) ? trim($_COOKIE[$cookie_email]) : '';
 	$comment_author_url = isset($_COOKIE[$cookie_url]) ? trim($_COOKIE[$cookie_url]) : '';
-	$redirect = htmlspecialchars(url_rel_to_same_host(regenerate_url('','','','&'), $htsrv_url));
+	$redirect = myhtmlspecialchars(url_rel_to_same_host(regenerate_url('','','','&'), $htsrv_url));
 ?>
 
 <!-- form to add a comment -->
@@ -76,7 +76,7 @@
 	<tr valign="top" bgcolor="#eeeeee">
 		<td align="right"><label for="comment"><strong><?php echo T_('Comment text') ?>:</strong></label></td>
 		<td align="left" width="450"><textarea cols="50" rows="12" name="p" id="comment" tabindex="4"></textarea><br />
-			<small><?php echo T_('Allowed XHTML tags'), ': ', htmlspecialchars(str_replace( '><',', ', $comment_allowed_tags)) ?></small>
+			<small><?php echo T_('Allowed XHTML tags'), ': ', myhtmlspecialchars(str_replace( '><',', ', $comment_allowed_tags)) ?></small>
 		</td>
 	</tr>
 
diff -ru b2evolution.orig/blogs/skins/_item_comment_form.inc.php b2evolution/blogs/skins/_item_comment_form.inc.php
--- b2evolution.orig/blogs/skins/_item_comment_form.inc.php	2012-04-22 17:00:30.382381675 +0200
+++ b2evolution/blogs/skins/_item_comment_form.inc.php	2012-04-22 17:00:31.174401499 +0200
@@ -194,7 +194,7 @@
 
 	// Message field:
 	$note = '';
-	// $note = T_('Allowed XHTML tags').': '.htmlspecialchars(str_replace( '><',', ', $comment_allowed_tags));
+	// $note = T_('Allowed XHTML tags').': '.myhtmlspecialchars(str_replace( '><',', ', $comment_allowed_tags));
 	$Form->textarea( 'p', $comment_content, $params['textarea_lines'], T_('Comment text'), $note, 38, 'bComment' );
 
 	// set b2evoCanvas for plugins
diff -ru b2evolution.orig/blogs/skins/_login.disp.php b2evolution/blogs/skins/_login.disp.php
--- b2evolution.orig/blogs/skins/_login.disp.php	2012-04-22 17:00:30.382381675 +0200
+++ b2evolution/blogs/skins/_login.disp.php	2012-04-22 17:00:31.174401499 +0200
@@ -49,7 +49,7 @@
 		&& strpos($ReqHost.$redirect_to, $admin_url ) !== 0 )
 	{ // No login required, allow to pass through
 		// TODO: dh> validate redirect_to param?!
-		$links[] = '<a href="'.htmlspecialchars(url_rel_to_same_host($redirect_to, $ReqHost)).'">'
+		$links[] = '<a href="'.myhtmlspecialchars(url_rel_to_same_host($redirect_to, $ReqHost)).'">'
 		./* Gets displayed as link to the location on the login form if no login is required */ T_('Abort login!').'</a>';
 	}
 
diff -ru b2evolution.orig/blogs/skins_adm/login/_login_form.main.php b2evolution/blogs/skins_adm/login/_login_form.main.php
--- b2evolution.orig/blogs/skins_adm/login/_login_form.main.php	2012-04-22 17:00:30.206377269 +0200
+++ b2evolution/blogs/skins_adm/login/_login_form.main.php	2012-04-22 17:00:31.162401197 +0200
@@ -39,7 +39,7 @@
 			$redirect_to = $baseurl;
 		}
 		$Messages->add( sprintf( T_('Note: You are already logged in as %s!'), $tmp_User->get('login') )
-			.' <a href="'.htmlspecialchars($redirect_to).'">'.T_('Continue').' &raquo;</a>', 'note' );
+			.' <a href="'.myhtmlspecialchars($redirect_to).'">'.T_('Continue').' &raquo;</a>', 'note' );
 	}
 	unset($tmp_User);
 }
@@ -87,7 +87,7 @@
 	&& strpos($ReqHost.$redirect_to, $admin_url ) !== 0 )
 { // No login required, allow to pass through
 	// TODO: dh> validate redirect_to param?!
-	$links[] = '<a href="'.htmlspecialchars(url_rel_to_same_host($redirect_to, $ReqHost)).'">'
+	$links[] = '<a href="'.myhtmlspecialchars(url_rel_to_same_host($redirect_to, $ReqHost)).'">'
 	./* Gets displayed as link to the location on the login form if no login is required */ T_('Abort login!').'</a>';
 }
 
diff -ru b2evolution.orig/blogs/skins_adm/login/_reg_complete.main.php b2evolution/blogs/skins_adm/login/_reg_complete.main.php
--- b2evolution.orig/blogs/skins_adm/login/_reg_complete.main.php	2012-04-22 17:00:30.206377269 +0200
+++ b2evolution/blogs/skins_adm/login/_reg_complete.main.php	2012-04-22 17:00:31.162401197 +0200
@@ -59,7 +59,7 @@
 	$Form->end_fieldset();
 
 	echo '<p class="center"><a href="'
-		.htmlspecialchars(url_rel_to_same_host($redirect_to, $htsrv_url_sensitive))
+		.myhtmlspecialchars(url_rel_to_same_host($redirect_to, $htsrv_url_sensitive))
 		.'">'.T_('Continue').' &raquo;</a> '; // dh> TODO: this does not seem to be sensible for dir=rtl.
 	echo '</p>';
 }

41 Apr 22, 2012 19:41

The problem is not only in htmlspecialchars() function, there are other like htmlentities, html_entity_decode, get_html_translation_table etc. A lot easier is to convert your blog to UTF-8.

42 Apr 22, 2012 19:54

Create a file /locales/fr_FR/fr-FR.utf8.locale.php with this content

<?php
$locale_defs['fr-FR-utf8'] = array(
		'name' => NT_('French (FR) utf8'),
		'messages' => 'fr_FR',
		'charset' => 'utf-8',
		'datefmt' => 'd.m.y',
		'timefmt' => 'H:i:s',
		'startofweek' => 1,
	);
?>

Enable new locale on Global settings > Regional
Then select it as default locale on the same page
Edit locales everywhere to use this new locale (blogs, posts, users). You can do that directly in MySQL to make it easier. Edit table prefix if needed.

UPDATE evo_blogs SET blog_locale = "fr-FR-utf8";
UPDATE evo_users SET user_locale = "fr-FR-utf8";
UPDATE evo_items__item SET post_locale = "fr-FR-utf8";

Convert your b2evolution DB to UTF-8 with this script. Save is convert-db.php in b2evolution base directory (same where admin.php file is) and run with

http://yourwebsite.tld/convert-db.php


<?php
/**
 * Convert your b2evolution DB to UTF-8.
 * Place this script in the folder where "blogs" resides (is a subfolder of)
 * and execute it from the command line (or from your browser).
 *
 * @author http://daniel.hahler.de/
 * @license Public Domain
 */

/**
 * Change this to 0, if you do not want the DB default charset to be changed.
 * This is used for new tables (e.g. from plugins).
 */
define( 'ALSO_CHANGE_DB_DEFAULT', 1 );


error_reporting(E_ALL);
ini_set('display_errors', 1);

require dirname(__FILE__).'/conf/_config.php';
require $inc_path.'_main.inc.php';

$DB->halt_on_error = true;

foreach( $DB->get_col('SHOW TABLES FROM `'.$db_config['name'].'` LIKE "'.$tableprefix.'%"') as $table )
{
	echo "Converting $table... ";
	$DB->query( '
		ALTER TABLE `'.$table.'`
		DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci,
		CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci' );
	echo "OK.\n";
}

if( ALSO_CHANGE_DB_DEFAULT )
{
	echo "Changing default charset of DB...";
	$DB->query( 'ALTER DATABASE `'.$db_config['name'].'` CHARACTER SET utf8 COLLATE utf8_general_ci' );
	echo "OK.\n";
}

?>

Backup your database before you start

43 Apr 23, 2012 10:49

You may be right, it will be easier to convert my db to utf-8 but I think that I'm not the only one concern by this issue. It could be useful to add a section in the upgrade documentation and add utf-8 locales into b2evolution package.

On the other way,
- htmlentities is called 23 times, html_entity_decode 3 times, and get_html_translation_table 2 times.
- I dig into php documentation (assuming that any other function will also check ENT_COMPAT flag) but I did not find any other functions.
- If we want that the standard b2evolution package be compatible with php 5.3 and 5.4, I can finish my patch.

Regards.

44 Apr 23, 2012 13:30

It looks like all we have to do is force b2evo internal charset to utf8, [u]no changes required[/u] at all.

Try this:
backup your database
undo all your changes
set $evo_charset = 'utf8'; in /conf/_locales.php
enjoy :)

45 Apr 24, 2012 09:39

Excellent! That's work perfectly. Thanks a lot.

46 Mar 12, 2013 09:16

i gave php 5.4 shot, got the below errors on home, and instead of trying to fix it, switched back to 5.3 immedieately.

Here are the errors & warnings, just fyi:

Strict Standards: Declaration of GeneralSettings::get() should be compatible with AbstractSettings::get($col_key1, $col_key2 = NULL, $col_key3 = NULL) in ../inc/settings/model/_generalsettings.class.php on line 44

Warning: Creating default object from empty value in ../inc/settings/model/_abstractsettings.class.php on line 228

Strict Standards: Declaration of ItemListLight::query() should be compatible with Results::query($create_default_cols_if_needed = true, $append_limit = true, $append_order_by = true, $query_title = 'Results::Q...') in...l/inc/items/model/_itemlistlight.class.php on line 48

Strict Standards: Declaration of ItemQuery::where_keywords() should be compatible with SQL::WHERE_keywords($search, $search_kw_combine) in.../inc/items/model/_itemquery.class.php on line 752

Notice: Array to string conversion in .../inc/_core/_param.funcs.php on line 1388
Warning: Cannot modify header information - headers already sent by (output started at .../inc/settings/model/_generalsettings.class.php:44) in.../inc/_core/_template.funcs.php on line 210

Strict Standards: Declaration of avatars_Plugin::AdminAfterPageFooter() should be compatible with Plugin::AdminAfterPageFooter(&$params) in .../plugins/avatars_plugin/_avatars.plugin.php on line 28

Strict Standards: Declaration of advanced_search_plugin::GetDefaultSettings() should be compatible with Plugin::GetDefaultSettings(&$params) in .../plugins/advanced_search_plugin/_advanced_search.plugin.php on line 961

Strict Standards: Declaration of advanced_search_plugin::SkinBeginHtmlHead() should be compatible with Plugin::SkinBeginHtmlHead(&$params) in .../plugins/advanced_search_plugin/_advanced_search.plugin.php on line 961

Strict Standards: Declaration of advanced_search_plugin::SkinTag() should be compatible with Plugin::SkinTag(&$params) in .../plugins/advanced_search_plugin/_advanced_search.plugin.php on line 961

Strict Standards: Declaration of UserSettings::get() should be compatible with AbstractSettings::get($col_key1, $col_key2 = NULL, $col_key3 = NULL) in .../inc/users/model/_usersettings.class.php on line 213

Strict Standards: Declaration of UserSettings::set() should be compatible with AbstractSettings::set() in .../inc/users/model/_usersettings.class.php on line 213

Strict Standards: Declaration of BlogCache::get_option_list() should be compatible with DataObjectCache::get_option_list($default = 0, $allow_none = false, $method = 'get_name', $ignore_IDs = Array) in .../inc/collections/model/_blogcache.class.php on line 364

Strict Standards: Declaration of Blog::dbupdate() should be compatible with DataObject::dbupdate($auto_track_modification = true) in .../inc/collections/model/_blog.class.php on line 47

Strict Standards: Declaration of Skin::dbupdate() should be compatible with DataObject::dbupdate($auto_track_modification = true) in .../inc/skins/model/_skin.class.php on line 666

Strict Standards: Declaration of CollectionSettings::_load() should be compatible with AbstractSettings::_load($arg1 = NULL, $arg2 = NULL, $arg3 = NULL) in .../inc/collections/model/_collsettings.class.php on line 191

47 Mar 12, 2013 16:37

Apparently you kept the old config files. Here's the code from /conf/_advanced.php

// Most of the time you'll want to see all errors, including notices:
// b2evo should run notice free! (plugins too!)
if( version_compare( phpversion(), '5.3', '>=' ) )
{	// sam2kb> Disable E_STRICT messages on PHP > 5.3, there are numerous E_STRICT warnings displayed throughout the app
	error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
}
else
{
	error_reporting( E_ALL );
}

48 Mar 12, 2013 17:38

probably.. thanks for the answer, i'll give it another shot some time this week.
I was already warned that you are bound to end up with load of errors due to changes in 5.4.

I've read that php 5.4 is about 20% faster compared to 5.3 and easier on memory, so i am seriously considering on upgrading.It seems end of life will be announced for 5.3.22 by the end of this month.

49 Mar 13, 2013 00:01

I have php 5.4 on my workstation for about a year already. One of my websites runs 5.4. No problems at all.
The E_STRICT errors are ok, they don't do any harm. b2evolution is fully compatible with php 5.4 since v 4.1.5 if I'm not mistaken

50 Mar 13, 2013 01:04

Yea i know, it was not a planned upgrade already. I was upgrading mysql to 5.5 and while i was at it, i thought why not give php 5.4 a shot as well.. After some reading, i found about a few issues like suhosin (it's not really an issue actually since 5.4 is far more formidable that you dont even need suhosin but..) and some precautions like sorting out / supressing warnings etc. before i go all the way next time. But i will definitely do it at the shortest time, also thinking of upgrading b2 to v5 too ! it's about time


Form is loading...