Commit e4096e14 authored by Steven Wittens's avatar Steven Wittens

- #27551: Rename check_output() to check_markup(). Needs contrib updates!

parent e5ad13e3
......@@ -104,7 +104,7 @@ function block_block($op = 'list', $delta = 0, $edit = array()) {
case 'view':
$block = db_fetch_object(db_query('SELECT * FROM {boxes} WHERE bid = %d', $delta));
$data['subject'] = check_plain($block->title);
$data['content'] = check_output($block->body, $block->format, FALSE);
$data['content'] = check_markup($block->body, $block->format, FALSE);
return $data;
}
}
......
......@@ -104,7 +104,7 @@ function block_block($op = 'list', $delta = 0, $edit = array()) {
case 'view':
$block = db_fetch_object(db_query('SELECT * FROM {boxes} WHERE bid = %d', $delta));
$data['subject'] = check_plain($block->title);
$data['content'] = check_output($block->body, $block->format, FALSE);
$data['content'] = check_markup($block->body, $block->format, FALSE);
return $data;
}
}
......
......@@ -277,7 +277,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
$text = '';
$comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
while ($comment = db_fetch_object($comments)) {
$text .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_output($comment->comment, $comment->format, FALSE);
$text .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_markup($comment->comment, $comment->format, FALSE);
}
return $text;
......@@ -472,8 +472,8 @@ function comment_validate($edit) {
// 1) Filter it into HTML
// 2) Strip out all HTML tags
// 3) Convert entities back to plain-text.
// Note: format is checked by check_output().
$edit['subject'] = truncate_utf8(decode_entities(strip_tags(check_output($edit['comment'], $edit['format']))), 29, TRUE);
// Note: format is checked by check_markup().
$edit['subject'] = truncate_utf8(decode_entities(strip_tags(check_markup($edit['comment'], $edit['format']))), 29, TRUE);
}
// Validate the comment's body.
......@@ -1458,7 +1458,7 @@ function theme_comment_view($comment, $links = '', $visible = 1) {
// Switch to folded/unfolded view of the comment
if ($visible) {
$comment->comment = check_output($comment->comment, $comment->format, FALSE);
$comment->comment = check_markup($comment->comment, $comment->format, FALSE);
$output .= theme('comment', $comment, $links);
}
else {
......
......@@ -277,7 +277,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
$text = '';
$comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
while ($comment = db_fetch_object($comments)) {
$text .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_output($comment->comment, $comment->format, FALSE);
$text .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_markup($comment->comment, $comment->format, FALSE);
}
return $text;
......@@ -472,8 +472,8 @@ function comment_validate($edit) {
// 1) Filter it into HTML
// 2) Strip out all HTML tags
// 3) Convert entities back to plain-text.
// Note: format is checked by check_output().
$edit['subject'] = truncate_utf8(decode_entities(strip_tags(check_output($edit['comment'], $edit['format']))), 29, TRUE);
// Note: format is checked by check_markup().
$edit['subject'] = truncate_utf8(decode_entities(strip_tags(check_markup($edit['comment'], $edit['format']))), 29, TRUE);
}
// Validate the comment's body.
......@@ -1458,7 +1458,7 @@ function theme_comment_view($comment, $links = '', $visible = 1) {
// Switch to folded/unfolded view of the comment
if ($visible) {
$comment->comment = check_output($comment->comment, $comment->format, FALSE);
$comment->comment = check_markup($comment->comment, $comment->format, FALSE);
$output .= theme('comment', $comment, $links);
}
else {
......
......@@ -671,7 +671,7 @@ function filter_list_format($format) {
* showing content that is not (yet) stored in the database (eg. upon preview),
* set to TRUE so the user's permissions are checked.
*/
function check_output($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
// When $check = true, do an access check on $format.
if (isset($text) && (!$check || filter_access($format))) {
if ($format == FILTER_FORMAT_DEFAULT) {
......
......@@ -671,7 +671,7 @@ function filter_list_format($format) {
* showing content that is not (yet) stored in the database (eg. upon preview),
* set to TRUE so the user's permissions are checked.
*/
function check_output($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
// When $check = true, do an access check on $format.
if (isset($text) && (!$check || filter_access($format))) {
if ($format == FILTER_FORMAT_DEFAULT) {
......
......@@ -510,10 +510,10 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
function node_prepare($node, $teaser = FALSE) {
$node->readmore = (strlen($node->teaser) < strlen($node->body));
if ($teaser == FALSE) {
$node->body = check_output($node->body, $node->format, FALSE);
$node->body = check_markup($node->body, $node->format, FALSE);
}
else {
$node->teaser = check_output($node->teaser, $node->format, FALSE);
$node->teaser = check_markup($node->teaser, $node->format, FALSE);
}
return $node;
}
......
......@@ -510,10 +510,10 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
function node_prepare($node, $teaser = FALSE) {
$node->readmore = (strlen($node->teaser) < strlen($node->body));
if ($teaser == FALSE) {
$node->body = check_output($node->body, $node->format, FALSE);
$node->body = check_markup($node->body, $node->format, FALSE);
}
else {
$node->teaser = check_output($node->teaser, $node->format, FALSE);
$node->teaser = check_markup($node->teaser, $node->format, FALSE);
}
return $node;
}
......
......@@ -246,7 +246,7 @@ function profile_view_field($user, $field) {
case 'textfield':
return check_plain($value);
case 'textarea':
return check_output($value);
return check_markup($value);
case 'selection':
return $browse ? l($value, "profile/$field->name/$value") : check_plain($value);
case 'checkbox':
......
......@@ -246,7 +246,7 @@ function profile_view_field($user, $field) {
case 'textfield':
return check_plain($value);
case 'textarea':
return check_output($value);
return check_markup($value);
case 'selection':
return $browse ? l($value, "profile/$field->name/$value") : check_plain($value);
case 'checkbox':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment