Ticket #57: ticket-57 v1.diff
File ticket-57 v1.diff, 3.0 KB (added by , 18 years ago) |
---|
-
html/inc/db.inc
172 172 return $str; 173 173 } 174 174 175 ?> 175 // Convert to entities, while preserving already-encoded entities. 176 // Do NOT use if $str contains valid HTML tags. 177 function boinc_htmlentities($str) { 178 $str = html_entity_decode($str, ENT_COMPAT, "UTF-8"); 179 $str = htmlentities($str, ENT_COMPAT, "UTF-8"); 180 return $str; 181 } 182 183 ?> 184 No newline at end of file -
html/user/edit_user_info_action.php
8 8 db_init(); 9 9 $user = get_logged_in_user(); 10 10 11 $name = process_user_text(post_str("user_name"));11 $name = boinc_htmlentities(process_user_text(post_str("user_name"))); 12 12 if ($name != strip_tags($name)) { 13 13 error_page("HTML tags not allowed in name"); 14 14 } -
html/user/team_create_action.php
8 8 9 9 $user = get_logged_in_user(); 10 10 11 $name = process_user_text(strip_tags(post_str("name")));11 $name = boinc_htmlentities(process_user_text(strip_tags(post_str("name")))); 12 12 if (strlen($name) == 0) { 13 13 error_page("Must set team name"); 14 14 } … … 17 17 if (strstr($url, "http://")) { 18 18 $url = substr($url, 7); 19 19 } 20 $type = process_user_text(strip_tags(post_str("type", true))); 20 $type = process_user_text(strip_tags(post_str("type", true))); 21 21 if (!is_valid_team_type($type)) { 22 22 $type = 'None'; 23 23 } 24 24 25 25 $name_html = process_user_text(post_str("name_html", true)); 26 $description = process_user_text(post_str("description", true));26 $description = boinc_htmlentities(process_user_text(post_str("description", true))); 27 27 $country = process_user_text(post_str("country", true)); 28 28 29 29 if (!is_valid_country($country)) { -
html/user/team_edit_action.php
18 18 if ($x) { 19 19 $team_url = substr($team_url, 7); 20 20 } 21 $team_name = process_user_text(strip_tags(post_str("name")));21 $team_name = boinc_htmlentities(process_user_text(strip_tags(post_str("name")))); 22 22 $team_name_lc = strtolower($team_name); 23 23 $team_name_html = process_user_text(post_str("name_html", true)); //Do we really not want to 24 $team_description = process_user_text(post_str("description", true)); //scrub out bad HTML tags?24 $team_description = boinc_htmlentities(process_user_text(post_str("description", true))); //scrub out bad HTML tags? 25 25 $type = process_user_text(post_str("type", true)); 26 26 $country = process_user_text(post_str("country", true)); 27 27