Commit aca442cf authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

UTF-8 validate messages before passing them to g_message().

2003-06-06  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/message.pdb: UTF-8 validate messages before
	passing them to g_message().

	* app/pdb/message_cmds.c
	* libgimp/gimpmessage_pdb.c: regenerated.
parent c46c9b53
2003-06-06 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/message.pdb: UTF-8 validate messages before
passing them to g_message().
* app/pdb/message_cmds.c
* libgimp/gimpmessage_pdb.c: regenerated.
2003-06-06 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/script-fu/scripts/addborder.scm: fix for #114495 (Script-Fu:
Add Border can't be (complete) undone.)
* plug-ins/script-fu/scripts/addborder.scm: fix for #114495
(Script-Fu: Add Border can't be (complete) undone.)
2003-06-06 Sven Neumann <sven@gimp.org>
......@@ -54,7 +54,17 @@ message_invoker (Gimp *gimp,
success = FALSE;
if (success)
g_message ("%s", message);
{
if (! g_utf8_validate (message, -1, NULL))
{
g_warning ("Strings passed to g_message() must be in UTF-8 encoding.");
success = FALSE;
}
else
{
g_message ("%s", message);
}
}
return procedural_db_return_args (&message_proc, success);
}
......@@ -72,7 +82,7 @@ static ProcRecord message_proc =
{
"gimp_message",
"Displays a dialog box with a message.",
"Displays a dialog box with a message. Useful for status or error reporting.",
"Displays a dialog box with a message. Useful for status or error reporting. The message must be in UTF-8 encoding.",
"Manish Singh",
"Manish Singh",
"1998",
......
......@@ -32,7 +32,7 @@
* Displays a dialog box with a message.
*
* Displays a dialog box with a message. Useful for status or error
* reporting.
* reporting. The message must be in UTF-8 encoding.
*
* Returns: TRUE on success.
*/
......
......@@ -27,6 +27,7 @@ sub message {
$help = <<'HELP';
Displays a dialog box with a message. Useful for status or error reporting.
The message must be in UTF-8 encoding.
HELP
&pdb_misc;
......@@ -36,7 +37,20 @@ HELP
desc => 'Message to display in the dialog' }
);
%invoke = ( code => 'g_message ("%s", message);' );
%invoke = ( code => <<CODE
{
if (! g_utf8_validate (message, -1, NULL))
{
g_warning ("Strings passed to g_message() must be in UTF-8 encoding.");
success = FALSE;
}
else
{
g_message ("%s", message);
}
}
CODE
);
}
sub message_get_handler {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment