@@ -1045,9 +1045,9 @@ public static function getPosts($blog_id, $filter = '1=1', $max_number_of_posts
1045
1045
'id_autor ' => $ blog_post ['author_id ' ],
1046
1046
'autor ' => $ blog_post ['firstname ' ].' ' .$ blog_post ['lastname ' ],
1047
1047
'username ' => $ blog_post ['username ' ],
1048
- 'title ' => stripslashes ($ blog_post ['title ' ]),
1048
+ 'title ' => Security:: remove_XSS ($ blog_post ['title ' ]),
1049
1049
'extract ' => self ::getPostExtract ($ blog_post ['full_text ' ], BLOG_MAX_PREVIEW_CHARS ),
1050
- 'content ' => stripslashes ($ blog_post ['full_text ' ]),
1050
+ 'content ' => Security:: remove_XSS ($ blog_post ['full_text ' ]),
1051
1051
'post_date ' => Display::dateToStringAgoAndLongDate ($ blog_post ['date_creation ' ]),
1052
1052
'n_comments ' => $ blog_post_comments ['number_of_comments ' ],
1053
1053
'files ' => $ fileArray ,
@@ -1104,7 +1104,6 @@ public static function getSinglePost($blog_id, $post_id)
1104
1104
global $ charset ;
1105
1105
1106
1106
$ course_id = api_get_course_int_id ();
1107
- $ courseParams = api_get_cidreq ();
1108
1107
$ blog_id = intval ($ blog_id );
1109
1108
$ post_id = intval ($ post_id );
1110
1109
@@ -1182,9 +1181,9 @@ class="btn btn-default"
1182
1181
'id_author ' => $ blog_post ['author_id ' ],
1183
1182
'author ' => $ blog_post ['firstname ' ].' ' .$ blog_post ['lastname ' ],
1184
1183
'username ' => $ blog_post ['username ' ],
1185
- 'title ' => stripslashes ($ blog_post ['title ' ]),
1184
+ 'title ' => Security:: remove_XSS ($ blog_post ['title ' ]),
1186
1185
'extract ' => api_get_short_text_from_html (
1187
- stripslashes ($ blog_post ['full_text ' ]),
1186
+ Security:: remove_XSS ($ blog_post ['full_text ' ]),
1188
1187
400
1189
1188
),
1190
1189
'content ' => $ post_text ,
@@ -1252,7 +1251,7 @@ public static function getThreadedComments(
1252
1251
$ commentActions = null ;
1253
1252
$ ratingSelect = null ;
1254
1253
$ comment_text = make_clickable (stripslashes ($ comment ['comment ' ]));
1255
- $ comment_text = stripslashes ($ comment_text );
1254
+ $ comment_text = Security:: remove_XSS ($ comment_text );
1256
1255
$ commentActions .= Display::toolbarButton (
1257
1256
get_lang ('ReplyToThisComment ' ),
1258
1257
'# ' ,
@@ -1300,7 +1299,7 @@ class="btn btn-default"
1300
1299
'iid ' => $ comment ['iid ' ],
1301
1300
'id_comment ' => $ comment ['comment_id ' ],
1302
1301
'id_curso ' => $ comment ['c_id ' ],
1303
- 'title ' => $ comment ['title ' ],
1302
+ 'title ' => Security:: remove_XSS ( $ comment ['title ' ]) ,
1304
1303
'content ' => $ comment_text ,
1305
1304
'id_author ' => $ comment ['author_id ' ],
1306
1305
'comment_date ' => Display::dateToStringAgoAndLongDate ($ comment ['date_creation ' ]),
@@ -1881,11 +1880,6 @@ public static function displayAssignedTasksList($blog_id)
1881
1880
$ css_class = (($ counter % 2 ) == 0 ) ? "row_odd " : "row_even " ;
1882
1881
$ delete_icon = ($ assignment ['system_task ' ] == '1 ' ) ? "delete_na.png " : "delete.png " ;
1883
1882
$ delete_title = ($ assignment ['system_task ' ] == '1 ' ) ? get_lang ('DeleteSystemTask ' ) : get_lang ('DeleteTask ' );
1884
- $ delete_link = ($ assignment ['system_task ' ] == '1 ' ) ? '# ' : api_get_self ().'?action=manage_tasks&blog_id= ' .$ assignment ['blog_id ' ].'&do=delete&task_id= ' .$ assignment ['task_id ' ].'& ' .api_get_cidreq ();
1885
- $ delete_confirm = ($ assignment ['system_task ' ] == '1 ' ) ? '' : 'onclick="javascript:if(!confirm( \'' .addslashes (
1886
- api_htmlentities (get_lang ("ConfirmYourChoice " ), ENT_QUOTES , $ charset )
1887
- ).'\')) return false;" ' ;
1888
-
1889
1883
$ username = api_htmlentities (sprintf (get_lang ('LoginX ' ), $ assignment ['username ' ]), ENT_QUOTES );
1890
1884
1891
1885
$ return .= '<tr class=" ' .$ css_class .'" valign="top"> ' ;
@@ -1894,8 +1888,8 @@ public static function displayAssignedTasksList($blog_id)
1894
1888
api_get_person_name ($ assignment ['firstname ' ], $ assignment ['lastname ' ]),
1895
1889
['title ' => $ username ]
1896
1890
).'</td> ' ;
1897
- $ return .= '<td> ' .stripslashes ($ assignment ['title ' ]).'</td> ' ;
1898
- $ return .= '<td> ' .stripslashes ($ assignment ['description ' ]).'</td> ' ;
1891
+ $ return .= '<td> ' .Security:: remove_XSS ($ assignment ['title ' ]).'</td> ' ;
1892
+ $ return .= '<td> ' .Security:: remove_XSS ($ assignment ['description ' ]).'</td> ' ;
1899
1893
$ return .= '<td> ' .$ assignment ['target_date ' ].'</td> ' ;
1900
1894
$ return .= '<td width="50"> ' ;
1901
1895
$ return .= '<a
@@ -2414,6 +2408,7 @@ public static function displayPostSelectionForTask($blog_id, $task_id)
2414
2408
AND c_id = $ course_id " ;
2415
2409
$ result = Database::query ($ sql );
2416
2410
$ row = Database::fetch_assoc ($ result );
2411
+
2417
2412
// Get posts and authors
2418
2413
$ sql = "SELECT post.*, user.lastname, user.firstname, user.username
2419
2414
FROM $ tbl_blogs_posts post
@@ -2425,8 +2420,8 @@ public static function displayPostSelectionForTask($blog_id, $task_id)
2425
2420
2426
2421
// Display
2427
2422
$ return = '<span class="blogpost_title"> ' .
2428
- get_lang ('SelectTaskArticle ' ).' " ' .stripslashes ($ row ['title ' ]).'"</span> ' ;
2429
- $ return .= '<span style="font-style: italic;""> ' .stripslashes ($ row ['description ' ]).'</span><br><br> ' ;
2423
+ get_lang ('SelectTaskArticle ' ).' " ' .Security:: remove_XSS ($ row ['title ' ]).'"</span> ' ;
2424
+ $ return .= '<span style="font-style: italic;""> ' .Security:: remove_XSS ($ row ['description ' ]).'</span><br><br> ' ;
2430
2425
2431
2426
if (Database::num_rows ($ result ) == 0 ) {
2432
2427
$ return .= get_lang ('NoArticles ' );
@@ -2437,9 +2432,8 @@ public static function displayPostSelectionForTask($blog_id, $task_id)
2437
2432
while ($ blog_post = Database::fetch_array ($ result )) {
2438
2433
$ username = api_htmlentities (sprintf (get_lang ('LoginX ' ), $ blog_post ['username ' ]), ENT_QUOTES );
2439
2434
$ return .= '<a href=" ' .$ url .'&blog_id= ' .$ blog_id .'&task_id= ' .$ task_id .'&post_id= ' .$ blog_post ['post_id ' ].'#add_comment"> ' .
2440
- stripslashes (
2441
- $ blog_post ['title ' ]
2442
- ).'</a>, ' .get_lang ('WrittenBy ' ).' ' .stripslashes (
2435
+ Security::remove_XSS ($ blog_post ['title ' ]).'</a>, ' .
2436
+ get_lang ('WrittenBy ' ).' ' .stripslashes (
2443
2437
Display::tag (
2444
2438
'span ' ,
2445
2439
api_get_person_name ($ blog_post ['firstname ' ], $ blog_post ['lastname ' ]),
@@ -2502,8 +2496,6 @@ public static function displayUserSubscriptionForm($blog_id)
2502
2496
2503
2497
$ html .= '<legend> ' .get_lang ('SubscribeMembers ' ).'</legend> ' ;
2504
2498
2505
- $ properties ['width ' ] = '100% ' ;
2506
-
2507
2499
// Get blog members' id.
2508
2500
$ sql = "SELECT user.user_id FROM $ tbl_users user
2509
2501
INNER JOIN $ tbl_blogs_rel_user blogs_rel_user
@@ -2630,7 +2622,6 @@ public static function displayUserUnsubscriptionForm($blog_id)
2630
2622
2631
2623
$ html .= '<legend> ' .get_lang ('UnsubscribeMembers ' ).'</legend> ' ;
2632
2624
2633
- $ properties ["width " ] = "100% " ;
2634
2625
//table column titles
2635
2626
$ column_header [] = ['' , false , '' ];
2636
2627
if ($ is_western_name_order ) {
0 commit comments