2010-10-28 Sergio Martin <sergio.martin@artica.es>

* include/functions_io.php
	include/functions_ui.php: Fixed the html setting in the header 
	for the dashboard bug 3094692 



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3475 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-10-28 11:06:30 +00:00
parent 91415e2cce
commit 9d065a5489
3 changed files with 43 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2010-10-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_io.php
include/functions_ui.php: Fixed the html setting in the header
for the dashboard bug 3094692
2010-10-27 Miguel de Dios <miguel.dedios@artica.es> 2010-10-27 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/jquery.ui.datepicker.js, * include/javascript/jquery.ui.datepicker.js,
@ -247,6 +253,7 @@
* godmode/setup/setup.php: Use added images. * godmode/setup/setup.php: Use added images.
>>>>>>> .r3474
2010-10-25 Junichi Satoh <junichi@rworks.jp> 2010-10-25 Junichi Satoh <junichi@rworks.jp>
* godmode/agentes/module_manager_editor_network.php: Added enterprise * godmode/agentes/module_manager_editor_network.php: Added enterprise

View File

@ -92,11 +92,6 @@ function safe_input_html($value) {
if (! mb_check_encoding ($value, 'UTF-8')) if (! mb_check_encoding ($value, 'UTF-8'))
$value = utf8_encode ($value); $value = utf8_encode ($value);
//Replace some characteres for html entities
for ($i=0;$i<33;$i++) {
$value = str_ireplace(chr($i),ascii_to_html($i), $value);
}
return $value; return $value;
} }
@ -175,6 +170,41 @@ function safe_output($value, $utf8 = true)
return $valueHtmlEncode; return $valueHtmlEncode;
} }
/**
* Convert the $value encode in html entity to clear char string. This function
* should be called always to "clean" HTML encoded data; to render to a text
* plain ascii file, to render to console, or to put in any kind of data field
* who doesn't make the HTML render by itself.
*
* @param mixed String or array of strings to be cleaned.
* @param boolean $utf8 Flag, set the output encoding in utf8, by default true.
*
* @return unknown_type
*/
function safe_output_html($value, $utf8 = true)
{
if (is_numeric($value))
return $value;
if (is_array($value)) {
array_walk($value, "safe_output");
return $value;
}
//Replace the html entitie of ( for the char
$value = str_replace("&#40;", '(', $value);
//Replace the html entitie of ) for the char
$value = str_replace("&#41;", ')', $value);
//Revert html entities to chars
for ($i=0;$i<33;$i++) {
$value = str_ireplace("&#x".dechex($i).";",html_to_ascii(dechex($i)), $value);
}
return $value;
}
/** /**
* Use to clean HTML entities when get_parameter or safe_input functions dont work * Use to clean HTML entities when get_parameter or safe_input functions dont work
* *

View File

@ -31,7 +31,7 @@
* @param string $suffix String at the end of a strimmed string. * @param string $suffix String at the end of a strimmed string.
*/ */
function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '&hellip;') { function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '&hellip;') {
$text = safe_output($text); $text = safe_output_html($text);
if (strlen($text) > ($numChars - 1)) { if (strlen($text) > ($numChars - 1)) {
$truncateText = mb_strimwidth($text, 0, ($numChars - 1)) . $suffix; $truncateText = mb_strimwidth($text, 0, ($numChars - 1)) . $suffix;