Skip to content

Commit

Permalink
changes needed for new s() and p() - see bug #2338
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Apr 14, 2006
1 parent 4986951 commit f8a5159
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,12 @@
$form->students = get_string("defaultcoursestudents");
}
}
} else {
$form = stripslashes_safe($form);
}

// !! no db access using data from $form beyond this point !!

$form->categories = get_records_select_menu("course_categories", "", "name", "id,name");

$courseformats = get_list_of_plugins("course/format");
Expand Down
2 changes: 1 addition & 1 deletion course/editsection.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</tr>
</table>
<input type="hidden" name="id" value="<?php echo $form->id ?>" />
<input type="hidden" name="sesskey" value="<?php echo $form->sesskey ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</form>
</center>
4 changes: 3 additions & 1 deletion course/editsection.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@

if (empty($form)) {
$form = $section;
} else {
$form = stripslashes_safe($form);
}

$form->sesskey = !empty($USER->id) ? $USER->sesskey : '';
// !! no db access using data from $form beyond this point !!

$usehtmleditor = can_use_html_editor();

Expand Down
2 changes: 1 addition & 1 deletion course/group-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@

<input type="hidden" name="group" value="<?php p($group->id) ?>" />
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
<input type="hidden" name="sesskey" value="<?php p($sesskey) ?>" />
<input type="hidden" name="sesskey" value="<?php sesskey() ?>" />
</form>
2 changes: 0 additions & 2 deletions course/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@

$usehtmleditor = false;

$sesskey = !empty($USER->id) ? $USER->sesskey : '';

include('group-edit.html');

echo "</body></html>";
Expand Down
2 changes: 1 addition & 1 deletion course/importstudents.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
?>
</select>
<br />
<input type="text" name="searchtext" size="30" value="<?php p($searchtext) ?>"
<input type="text" name="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onFocus ="document.studentform.add.disabled=true;
document.studentform.remove.disabled=true;
document.studentform.removeselect.selectedIndex=-1;
Expand Down
6 changes: 3 additions & 3 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1320,19 +1320,19 @@ function print_course_search($value="", $return=false, $format="plain") {
if ($format == 'plain') {
$output = '<form name="coursesearch" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<center><p align="center" class="coursesearchbox">';
$output .= '<input type="text" size="30" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="text" size="30" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '</p></center></form>';
} else if ($format == 'short') {
$output = '<form name="coursesearch" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<center><p align="center" class="coursesearchbox">';
$output .= '<input type="text" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="text" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '</p></center></form>';
} else if ($format == 'navbar') {
$output = '<form name="coursesearch" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<table border="0" cellpadding="0" cellspacing="0"><tr><td nowrap="nowrap">';
$output .= '<input type="text" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="text" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '</td></tr></table>';
$output .= '</form>';
Expand Down
4 changes: 4 additions & 0 deletions course/request.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
}
print_footer();
exit;
} else {
$form = stripslashes_safe($form);
}

// !! no db access using data from $form beyond this point !!
}

// print_simple_box(get_string('courserequestintro'),'center');
Expand Down
2 changes: 1 addition & 1 deletion course/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@


print_header("$site->fullname : $strsearchresults", $site->fullname,
"<a href=\"index.php\">$strcourses</a> -> <a href=\"search.php\">$strsearch</a> -> '".s($search)."'", "", "", "", $searchform);
"<a href=\"index.php\">$strcourses</a> -> <a href=\"search.php\">$strsearch</a> -> '".s($search, true)."'", "", "", "", $searchform);


$lastcategory = -1;
Expand Down
2 changes: 1 addition & 1 deletion course/student.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
?>
</select>
<br />
<input type="text" name="searchtext" size="30" value="<?php p($searchtext) ?>"
<input type="text" name="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onFocus ="document.studentform.add.disabled=true;
document.studentform.remove.disabled=true;
document.studentform.removeselect.selectedIndex=-1;
Expand Down
2 changes: 1 addition & 1 deletion course/teacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
} else {

if ($search != '') {
echo "<p align=\"center\">($strsearchresults : ".s($search).")</p>";
echo "<p align=\"center\">($strsearchresults : ".s($search, true).")</p>";
}

if (!$users = get_users(true, $search, true, $teacherlist)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3538,10 +3538,10 @@ function update_categories_search_button($search,$page,$perpage) {
return "<form target=\"$CFG->framename\" method=\"get\" action=\"$CFG->wwwroot/course/search.php\">".
"<input type=\"hidden\" name=\"edit\" value=\"$edit\" />".
"<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />".
"<input type=\"hidden\" name=\"search\" value=\"$search\" />".
"<input type=\"hidden\" name=\"search\" value=\"".s($search, true)."\" />".
"<input type=\"hidden\" name=\"page\" value=\"$page\" />".
"<input type=\"hidden\" name=\"perpage\" value=\"$perpage\" />".
"<input type=\"submit\" value=\"$string\" /></form>";
"<input type=\"submit\" value=\"".s($string)."\" /></form>";
}
}

Expand Down

0 comments on commit f8a5159

Please sign in to comment.