Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
e4096e14
Commit
e4096e14
authored
Jul 29, 2005
by
Steven Wittens
Browse files
-
#27551
: Rename check_output() to check_markup(). Needs contrib updates!
parent
e5ad13e3
Changes
10
Hide whitespace changes
Inline
Side-by-side
modules/block.module
View file @
e4096e14
...
...
@@ -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
;
}
}
...
...
modules/block/block.module
View file @
e4096e14
...
...
@@ -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
;
}
}
...
...
modules/comment.module
View file @
e4096e14
...
...
@@ -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
{
...
...
modules/comment/comment.module
View file @
e4096e14
...
...
@@ -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
{
...
...
modules/filter.module
View file @
e4096e14
...
...
@@ -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
)
{
...
...
modules/filter/filter.module
View file @
e4096e14
...
...
@@ -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
)
{
...
...
modules/node.module
View file @
e4096e14
...
...
@@ -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
;
}
...
...
modules/node/node.module
View file @
e4096e14
...
...
@@ -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;
}
...
...
modules/profile.module
View file @
e4096e14
...
...
@@ -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'
:
...
...
modules/profile/profile.module
View file @
e4096e14
...
...
@@ -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'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment