diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php
index fc1e15fa21..08c9b9b873 100644
--- a/main/forum/forumfunction.inc.php
+++ b/main/forum/forumfunction.inc.php
@@ -377,7 +377,7 @@ function show_add_forum_form($inputvalues=array()) {
}
} else { // the default values when editing = the data in the table
$defaults['forum_id']=isset($inputvalues['forum_id']) ? $inputvalues['forum_id'] : null;
- $defaults['forum_title']=prepare4display(html_entity_decode(isset($inputvalues['forum_title']) ? $inputvalues['forum_title'] : null,ENT_QUOTES,$charset));
+ $defaults['forum_title']=prepare4display(api_html_entity_decode(isset($inputvalues['forum_title']) ? $inputvalues['forum_title'] : null,ENT_QUOTES,$charset));
$defaults['forum_comment']=prepare4display(isset($inputvalues['forum_comment'])?$inputvalues['forum_comment']:null);
$defaults['forum_category']=isset($inputvalues['forum_category']) ? $inputvalues['forum_category'] : null;
$defaults['allow_anonymous_group']['allow_anonymous']=isset($inputvalues['allow_anonymous']) ? $inputvalues['allow_anonymous'] :null;
@@ -463,7 +463,7 @@ function show_edit_forumcategory_form($inputvalues=array()) {
// setting the default values
$defaultvalues['forum_category_id']=$inputvalues['cat_id'];
- $defaultvalues['forum_category_title']=prepare4display(html_entity_decode($inputvalues['cat_title'],ENT_QUOTES,$charset));
+ $defaultvalues['forum_category_title']=prepare4display(api_html_entity_decode($inputvalues['cat_title'],ENT_QUOTES,$charset));
$defaultvalues['forum_category_comment']=prepare4display($inputvalues['cat_comment']);
$form->setDefaults($defaultvalues);
@@ -1983,7 +1983,7 @@ function show_add_post_form($action='', $id='', $form_values='') {
// if we are replying or are quoting then we display a default title.
$values=get_post_information($my_post); // note: this has to be cleaned first
- $defaults['post_title']=get_lang('ReplyShort').html_entity_decode($values['post_title'],ENT_QUOTES,$charset);
+ $defaults['post_title']=get_lang('ReplyShort').api_html_entity_decode($values['post_title'],ENT_QUOTES,$charset);
// When we are quoting a message then we have to put that message into the wysiwyg editor.
// note: the style has to be hardcoded here because using class="quote" didn't work
if($action=='quote') {
@@ -2408,7 +2408,7 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
$form->addElement('style_submit_button', 'SubmitPost', get_lang('ModifyThread'), 'class="save"');
global $charset;
// setting the default values for the form elements
- $defaults['post_title']=prepare4display(html_entity_decode($current_post['post_title'],ENT_QUOTES,$charset));
+ $defaults['post_title']=prepare4display(api_html_entity_decode($current_post['post_title'],ENT_QUOTES,$charset));
$defaults['post_text']=prepare4display($current_post['post_text']);
if ( $current_post['post_notification']==1 ) {
$defaults['post_notification']=true;
@@ -3269,8 +3269,8 @@ function display_forum_search_results($search_term) {
//$search_results_item .= 'THREAD > ';
$search_results_item .= ''.$row['post_title'].'';
$search_results_item .= '
';
- if (strlen($row['post_title']) > 200 ) {
- $search_results_item .= substr(strip_tags($row['post_title']),0,200).'...';
+ if (api_strlen($row['post_title']) > 200 ) {
+ $search_results_item .= api_substr(strip_tags($row['post_title']),0,200).'...';
} else {
$search_results_item .= $row['post_title'];
}
diff --git a/main/forum/index.php b/main/forum/index.php
index aeac5a63dc..e35404b4fc 100644
--- a/main/forum/index.php
+++ b/main/forum/index.php
@@ -275,7 +275,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
echo '
';
if (api_is_allowed_to_edit(false,true) && !($forum_category['session_id']==0 && intval($session_id)!=0)) {
echo "".icon('../img/edit.gif',get_lang('Edit'))."";
- echo "".icon('../img/delete.gif',get_lang('Delete'))."";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."";
display_visible_invisible_icon('forumcategory', prepare4display($forum_category['cat_id']), prepare4display($forum_category['visibility']));
display_lock_unlock_icon('forumcategory',prepare4display($forum_category['cat_id']), prepare4display($forum_category['locked']));
display_up_down_icon('forumcategory',prepare4display($forum_category['cat_id']), $forum_categories_list);
@@ -409,7 +409,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
if ($forum['forum_of_group']<>'0') {
$my_all_groups_forum_name=isset($all_groups[$forum['forum_of_group']]['name']) ? $all_groups[$forum['forum_of_group']]['name'] : null;
$my_all_groups_forum_id=isset($all_groups[$forum['forum_of_group']]['id']) ? $all_groups[$forum['forum_of_group']]['id'] : null;
- $group_title=substr($my_all_groups_forum_name,0,30);
+ $group_title=api_substr($my_all_groups_forum_name,0,30);
$forum_title_group_addition=' ('.get_lang('GoTo').' '.$group_title.')';
@@ -448,7 +448,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
echo "\t\t | ";
if (api_is_allowed_to_edit(false,true) && !($forum['session_id']==0 && intval($session_id)!=0)) {
echo "".icon('../img/edit.gif',get_lang('Edit'))."";
- echo "".icon('../img/delete.gif',get_lang('Delete'))."";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."";
display_visible_invisible_icon('forum',$forum['forum_id'], $forum['visibility']);
display_lock_unlock_icon('forum',$forum['forum_id'], $forum['locked']);
display_up_down_icon('forum',$forum['forum_id'], $forums_in_category);
diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php
index 6fb4fb2ba2..bd5847ea80 100644
--- a/main/forum/viewforum.php
+++ b/main/forum/viewforum.php
@@ -442,7 +442,7 @@ if(is_array($threads)) {
if ($origin != 'learnpath') {
if (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) {
echo "".icon('../img/edit.gif',get_lang('Edit'))."\n";
- echo "".icon('../img/delete.gif',get_lang('Delete'))."";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."";
display_visible_invisible_icon('thread', $row['thread_id'], $row['visibility'], array("forum"=>$my_forum,'origin'=>$origin,"gidReq"=>$_SESSION['toolgroup']));
display_lock_unlock_icon('thread',$row['thread_id'], $row['locked'], array("forum"=>$my_forum,'origin'=>$origin,"gidReq"=>$_SESSION['toolgroup']));
echo "".icon('../img/deplacer_fichier.gif',get_lang('MoveThread'))."";
@@ -476,4 +476,4 @@ echo isset($table_list)?$table_list:'';
*/
if ($origin != 'learnpath') {
Display :: display_footer();
-}
\ No newline at end of file
+}
diff --git a/main/forum/viewforumcategory.php b/main/forum/viewforumcategory.php
index bd546b8f61..7836cef07c 100644
--- a/main/forum/viewforumcategory.php
+++ b/main/forum/viewforumcategory.php
@@ -257,7 +257,7 @@ if ($action_forums!='add') {
if (api_is_allowed_to_edit(false,true) && !($forum_category['session_id']==0 && intval($my_session)!=0)) {
echo ' | ';
echo "".icon('../img/edit.gif',get_lang('Edit'))."";
- echo "".icon('../img/delete.gif',get_lang('Delete'))."";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."";
display_visible_invisible_icon('forumcategory', $forum_category['cat_id'], $forum_category['visibility'], array("forumcategory"=>$_GET['forumcategory']));
display_lock_unlock_icon('forumcategory',$forum_category['cat_id'], $forum_category['locked'], array("forumcategory"=>$_GET['forumcategory']));
display_up_down_icon('forumcategory',$forum_category['cat_id'], $forum_categories_list);
@@ -388,7 +388,7 @@ if ($action_forums!='add') {
echo "\t\t | ";
if (api_is_allowed_to_edit(false,true) && !($forum['session_id']==0 && intval(isset($_SESSION['id_session'])?$_SESSION['id_session']:null)!=0)) {
echo "".icon('../img/edit.gif',get_lang('Edit'))."";
- echo "".icon('../img/delete.gif',get_lang('Delete'))."";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."";
display_visible_invisible_icon('forum',$forum['forum_id'], $forum['visibility'], array("forumcategory"=>$_GET['forumcategory']));
display_lock_unlock_icon('forum',$forum['forum_id'], $forum['locked'], array("forumcategory"=>$_GET['forumcategory']));
display_up_down_icon('forum',$forum['forum_id'], $forums_in_category);
@@ -419,4 +419,4 @@ if ($action_forums!='add') {
// footer
if ($origin!='learnpath') {
Display :: display_footer();
-}
\ No newline at end of file
+}
diff --git a/main/forum/viewthread_flat.inc.php b/main/forum/viewthread_flat.inc.php
index 80750debe6..ee3717ba7e 100644
--- a/main/forum/viewthread_flat.inc.php
+++ b/main/forum/viewthread_flat.inc.php
@@ -72,7 +72,7 @@ foreach ($rows as $row) {
if ($origin != 'learnpath') {
if (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) {
- echo "".icon('../img/delete.gif',get_lang('Delete'))."\n";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."\n";
display_visible_invisible_icon('post', $row['post_id'], $row['visible'],array('forum'=>Security::remove_XSS($_GET['forum']),'thread'=>Security::remove_XSS($_GET['thread']), 'origin'=>$origin ));
echo "\n";
if ($increment>0) {
@@ -159,4 +159,4 @@ foreach ($rows as $row) {
echo "";
$increment++;
}
-}
\ No newline at end of file
+}
diff --git a/main/forum/viewthread_nested.inc.php b/main/forum/viewthread_nested.inc.php
index 2688b13b5b..9665030562 100644
--- a/main/forum/viewthread_nested.inc.php
+++ b/main/forum/viewthread_nested.inc.php
@@ -79,7 +79,7 @@ foreach ($rows as $post) {
echo "".icon('../img/edit.gif',get_lang('Edit'))."\n";
}
if (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) {
- echo "".icon('../img/delete.gif',get_lang('Delete'))."\n";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."\n";
display_visible_invisible_icon('post', $post['post_id'], $post['visible'],array('forum'=>Security::remove_XSS($_GET['forum']),'thread'=>Security::remove_XSS($_GET['thread']) ));
echo "\n";
if ($count>0) {
@@ -189,4 +189,4 @@ function _phorum_recursive_sort($rows, &$threads, $seed=0, $indent=0) {
_phorum_recursive_sort($rows, $threads, $child, $indent);
}
}
-}
\ No newline at end of file
+}
diff --git a/main/forum/viewthread_threaded.inc.php b/main/forum/viewthread_threaded.inc.php
index 1a1c4cd28f..3456e346aa 100644
--- a/main/forum/viewthread_threaded.inc.php
+++ b/main/forum/viewthread_threaded.inc.php
@@ -246,7 +246,7 @@ if (($current_forum['allow_edit']==1 AND $rows[$display_post_id]['user_id']==$_u
}
if (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session']))
{
- echo "".icon('../img/delete.gif',get_lang('Delete'))."\n";
+ echo "".icon('../img/delete.gif',get_lang('Delete'))."\n";
display_visible_invisible_icon('post', $rows[$display_post_id]['post_id'], $rows[$display_post_id]['visible'],array('forum'=>Security::remove_XSS($_GET['forum']),'thread'=>Security::remove_XSS($_GET['thread']), 'post'=>Security::remove_XSS($_GET['post']) ));
echo "\n";
//verified the post minor
@@ -396,4 +396,4 @@ function _phorum_recursive_sort($rows, &$threads, $seed=0, $indent=0)
_phorum_recursive_sort($rows, $threads, $child, $indent);
}
}
-}
\ No newline at end of file
+}
|