aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-10-11 00:10:41 +0000
committerrvelices <rv-github@modusoptimus.com>2007-10-11 00:10:41 +0000
commit36e0e6e8f1a455367f363048fc1825aebbd67eee (patch)
tree35a00477557663dbf05d3d5ae28c14ac0fac7d69
parent5aafffb22b39c7347e261e2a7f56ba541e5f079e (diff)
- changed htmlentities to htmlspecialchars in comments.php (utf-8 issue)
- web service explorer in utf-8 - removed warning in function load_language - feature: show_queries also shows number of selected rows or number of affected rows git-svn-id: http://piwigo.org/svn/trunk@2134 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--comments.php4
-rw-r--r--include/functions.inc.php35
-rw-r--r--tools/ws.htm13
3 files changed, 27 insertions, 25 deletions
diff --git a/comments.php b/comments.php
index e65662439..aabb2f396 100644
--- a/comments.php
+++ b/comments.php
@@ -181,8 +181,8 @@ $template->assign_vars(
'L_COMMENT_TITLE' => $title,
'F_ACTION'=>PHPWG_ROOT_PATH.'comments.php',
- 'F_KEYWORD'=>@htmlentities(stripslashes($_GET['keyword'])),
- 'F_AUTHOR'=>@htmlentities(stripslashes($_GET['author'])),
+ 'F_KEYWORD'=>@htmlspecialchars(stripslashes($_GET['keyword'])),
+ 'F_AUTHOR'=>@htmlspecialchars(stripslashes($_GET['author'])),
'U_HOME' => make_index_url(),
)
diff --git a/include/functions.inc.php b/include/functions.inc.php
index e1723b601..afc91c9c2 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -516,7 +516,9 @@ function get_languages($target_charset = null)
continue; // the language encoding is not compatible with our charset
}
else
- { // probably english that is the same in all ISO-xxx and UTF-8
+ { // UTF-8
+ $language_name = convert_charset($language_name,
+ 'utf-8', $target_charset);
$languages[$file] = $language_name;
}
}
@@ -699,6 +701,17 @@ function pwg_query($query)
$output.= number_format($page['queries_time'], 3, '.', ' ').' s)';
$output.= "\n".'(total time : ';
$output.= number_format( ($time+$start-$t2), 3, '.', ' ').' s)';
+ if ( $result!=null and preg_match('/\s*SELECT\s+/i',$query) )
+ {
+ $output.= "\n".'(num rows : ';
+ $output.= mysql_num_rows($result).' )';
+ }
+ elseif ( $result!=null
+ and preg_match('/\s*INSERT|UPDATE|REPLACE|DELETE\s+/i',$query) )
+ {
+ $output.= "\n".'(affected rows : ';
+ $output.= mysql_affected_rows().' )';
+ }
$output.= "</pre>\n";
$debug .= $output;
@@ -1529,10 +1542,11 @@ function load_language($filename, $dirname = '', $language = '',
break;
}
- // universal language (like Eng) no conversion required
+ // UTF-8 ?
$f = $dir.'/'.$filename;
if (file_exists($f))
{
+ $source_charset = 'utf-8';
$source_file = $f;
break;
}
@@ -1547,19 +1561,6 @@ function load_language($filename, $dirname = '', $language = '',
break;
}
}
-
- if ($target_charset=='iso-8859-1' and
- in_array( substr($language,2), array('en','fr','de','es','it','nl') )
- )
- { // we accept conversion from UTF-8 to ISO-8859-1 for backward compatibility ONLY
- $f = $dir.'.utf-8/'.$filename;
- if (file_exists($f))
- {
- $source_charset = 'utf-8';
- $source_file = $f;
- break;
- }
- }
}
if ( !empty($source_file) )
@@ -1599,8 +1600,8 @@ function load_language($filename, $dirname = '', $language = '',
}
else
{
- $lang = array_merge( $lang, $load_lang );
- $lang_info = array_merge( $lang_info, $load_lang_info );
+ $lang = array_merge( $lang, (array)$load_lang );
+ $lang_info = array_merge( $lang_info, (array)$load_lang_info );
}
return true;
}
diff --git a/tools/ws.htm b/tools/ws.htm
index fe2b5840b..25eb21fe4 100644
--- a/tools/ws.htm
+++ b/tools/ws.htm
@@ -2,6 +2,7 @@
<html>
<head>
<title>PWG web service explorer</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="prototype.js" ></script>
<script type="text/javascript">
@@ -169,7 +170,7 @@ function fillNewMethod(method)
var isOptional = method.params[i].optional;
var acceptArray = method.params[i].acceptArray;
var defaultValue = method.params[i].defaultValue == null ? '' : method.params[i].defaultValue;
-
+
row.insertCell(0).innerHTML = method.params[i].name;
row.insertCell(1).innerHTML = '<span title="parameter is '+(isOptional ? 'optional':'required') +'">'+(isOptional ? '?':'*')+'</span>'
+ (method.params[i].acceptArray ? ' <span title="parameter can be an array; use | (pipe) character to split values">[ ]</span>':'');
@@ -333,7 +334,7 @@ a:hover {
<table>
<tr style="vertical-align:top">
-
+
<td>
<div id="methodDescription"></div>
<table>
@@ -346,7 +347,7 @@ a:hover {
</select>
</td>
</tr>
-
+
<tr>
<td>Response format:</td>
<td>
@@ -364,7 +365,7 @@ a:hover {
<a href="#" onclick="return pwgInvokeMethod(true)">Invoke (new Window)</a>
</p>
</td>
-
+
<td>
<table id="methodParams" border="1" cellspacing="0" cellpadding="2px">
@@ -380,10 +381,10 @@ a:hover {
</tbody>
</table>
</td>
-
+
</tr>
</table>
-
+
<div style="display:none;">
<!-- hiddenForm for POST -->
<form method="post" action="" target="invokeFrame" id="invokeForm">