Ticket #1129: sanitize_tags-escape_string-in-inc.diff
File sanitize_tags-escape_string-in-inc.diff, 7.4 KB (added by , 13 years ago) |
---|
-
uotd.inc
36 36 $user = lookup_user_id($profile->userid); 37 37 echo uotd_thumbnail($profile, $user); 38 38 echo user_links($user, true)."<br>"; 39 echo sub_sentence(output_transform(s trip_tags($profile->response1)), ' ', 150, true);39 echo sub_sentence(output_transform(sanitize_tags($profile->response1)), ' ', 150, true); 40 40 } 41 41 42 42 // return the last UOTD profile, or null … … 172 172 $x .= uotd_thumbnail($profile, $user); 173 173 $x .= user_links($user); 174 174 $x .= " ". 175 sub_sentence(s trip_tags(output_transform($profile->response1)), ' ',175 sub_sentence(sanitize_tags(output_transform($profile->response1)), ' ', 176 176 250, true); 177 177 } 178 178 else { -
pm.inc
128 128 } 129 129 130 130 function pm_send($from_user, $to_user, $subject, $content, $send_email) { 131 $sql_subject = boinc_real_escape_string(strip_tags($subject));132 $sql_content = boinc_real_escape_string($content);131 $sql_subject = BoincDb::escape_string(sanitize_tags($subject)); 132 $sql_content = BoincDb::escape_string($content); 133 133 $mid = BoincPrivateMessage::insert("(userid, senderid, date, subject, content) VALUES ($to_user->id, $from_user->id, UNIX_TIMESTAMP(), '$sql_subject', '$sql_content')"); 134 134 if (!$mid) { 135 135 error_page(tra("Couldn't create message")); -
forum.inc
235 235 if ($curpage > 0){ 236 236 $navbar = '<a href="forum_forum.php?id='.$forum->id.'&start='.(($curpage-1)*THREADS_PER_PAGE); 237 237 if ($sort) $navbar.='&sort='.$sort; 238 $navbar.= '"> <-- Previous</a> ';238 $navbar.= '"> <-- ".tra("Previous")."</a> '; 239 239 } 240 240 241 241 // Display a list of pages surrounding this one … … 256 256 if ($curpage+1 < $total){ 257 257 $navbar.= '<a href="forum_forum.php?id='.$forum->id.'&start='.(($curpage+1)*THREADS_PER_PAGE); 258 258 if ($sort) $navbar.='&sort='.$sort; 259 $navbar.= '"> Next--></a>';259 $navbar.= '"> ".tra("Next")." --></a>'; 260 260 } 261 261 262 262 } … … 280 280 // Process a user-supplied title to remove HTML stuff 281 281 // 282 282 function cleanup_title($title) { 283 $x = s trip_tags(bb2html($title));283 $x = sanitize_tags(bb2html($title)); 284 284 $x = trim($x); 285 285 if (strlen($x)==0) return "(no title)"; 286 286 else return $x; … … 794 794 795 795 function create_thread($title, $content, $user, $forum, $signature, $export) { 796 796 $title = trim($title); 797 $title = s trip_tags($title);797 $title = sanitize_tags($title); 798 798 $title = mysql_real_escape_string($title); 799 799 $now = time(); 800 800 $status = 0; -
user.inc
452 452 if (!is_valid_country($country)) return null; 453 453 454 454 $email_addr = BoincDb::escape_string($email_addr); 455 $name = s trip_tags($name);455 $name = sanitize_tags($name); 456 456 $name = BoincDb::escape_string($name); 457 457 $passwd_hash = BoincDb::escape_string($passwd_hash); 458 458 459 459 $country = BoincDb::escape_string($country); 460 $postal_code = s trip_tags(BoincDb::escape_string($postal_code));460 $postal_code = sanitize_tags(BoincDb::escape_string($postal_code)); 461 461 462 462 $uid = BoincUser::insert("(create_time, email_addr, name, authenticator, country, postal_code, total_credit, expavg_credit, expavg_time, project_prefs, teamid, send_email, show_hosts, cross_project_id, passwd_hash) values($now, '$email_addr', '$name', '$authenticator', '$country', '$postal_code', 0, 0, unix_timestamp(), '$project_prefs', $teamid, 1, 1, '$cross_project_id', '$passwd_hash')"); 463 463 -
team.inc
536 536 function make_team( 537 537 $userid, $name, $url, $type, $name_html, $description, $country 538 538 ) { 539 $name = BoincDb::escape_string(s trip_tags($name));539 $name = BoincDb::escape_string(sanitize_tags($name)); 540 540 if (strlen($name) == 0) return null; 541 541 $name_lc = strtolower($name); 542 $url = BoincDb::escape_string(s trip_tags($url));542 $url = BoincDb::escape_string(sanitize_tags($url)); 543 543 if (strstr($url, "http://")) { 544 544 $url = substr($url, 7); 545 545 } -
forum_rss.inc
43 43 } 44 44 //$t = htmlspecialchars($t); 45 45 echo "<item> 46 <title><![CDATA[".s trip_tags(bb2html($thread->title))."]]></title>46 <title><![CDATA[".sanitize_tags(bb2html($thread->title))."]]></title> 47 47 <link>$unique_url</link> 48 48 <guid isPermaLink=\"true\">$unique_url</guid> 49 49 <description><![CDATA[\n$t\n]]></description> -
profile.inc
177 177 178 178 if (strlen($profile->response1) != 0) { 179 179 $temp = $profile->response1; 180 $description = "(\"" . sub_sentence(s trip_tags($temp), ' ', MAX_DESC_LENGTH, true) . "\")";180 $description = "(\"" . sub_sentence(sanitize_tags($temp), ' ', MAX_DESC_LENGTH, true) . "\")"; 181 181 182 182 } 183 183 -
util.inc
133 133 ) { 134 134 global $caching, $cache_control_extra, $did_page_head; 135 135 136 136 $did_page_head = true; 137 137 $stylesheet = URL_BASE.STYLESHEET; 138 138 $rssname = PROJECT . " RSS 2.0"; 139 139 $rsslink = URL_BASE."rss_main.php"; … … 149 149 echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"; 150 150 151 151 if (!$title_plain) { 152 echo "<html><head><title>".s trip_tags($title)."</title>\n";152 echo "<html><head><title>".sanitize_tags($title)."</title>\n"; 153 153 } else { 154 echo "<html><head><title>".s trip_tags($title_plain)."</title>\n";154 echo "<html><head><title>".sanitize_tags($title_plain)."</title>\n"; 155 155 } 156 156 echo "<link rel=stylesheet type=\"text/css\" href=\"".URL_BASE."main.css\" media=\"all\" /> 157 157 <link rel=stylesheet type=\"text/css\" href=\"$stylesheet\"> -
db.inc
73 73 } 74 74 75 75 function lookup_user_name($name) { 76 // TODO: is the following double escaped? Why? 76 77 $name = BoincDb::escape_string($name); 77 78 $users = BoincUser::enum("name='".boinc_real_escape_string($name)."'"); 78 79 if (sizeof($users)==1) { … … 110 111 return BoincApp::lookup_id($id); 111 112 } 112 113 114 // DEPRECATED: use BoincDb::escape_string where possible 115 // 113 116 // apply this to any user-supplied strings used in queries 114 // 117 // 115 118 function boinc_real_escape_string($x) { 116 119 if (version_compare(phpversion(),"4.3.0")>=0) { 117 120 return BoincDb::escape_string($x);