Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
b33a215c
Commit
b33a215c
authored
Sep 16, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2251111
by jibran | dawehner: Remove format_rss_item() and format_rss_channel().
parent
2345f05d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
40 deletions
+0
-40
core/includes/common.inc
core/includes/common.inc
+0
-40
No files found.
core/includes/common.inc
View file @
b33a215c
...
...
@@ -403,46 +403,6 @@ function check_url($uri) {
* Functions to format numbers, strings, dates, etc.
*/
/**
* Formats an RSS channel.
*
* Arbitrary elements may be added using the $args associative array.
*/
function
format_rss_channel
(
$title
,
$link
,
$description
,
$items
,
$langcode
=
NULL
,
$args
=
array
())
{
$langcode
=
$langcode
?
$langcode
:
\
Drupal
::
languageManager
()
->
getCurrentLanguage
(
LanguageInterface
::
TYPE_CONTENT
)
->
id
;
$output
=
"<channel>
\n
"
;
$output
.
=
' <title>'
.
String
::
checkPlain
(
$title
)
.
"</title>
\n
"
;
$output
.
=
' <link>'
.
check_url
(
$link
)
.
"</link>
\n
"
;
// The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
// We strip all HTML tags, but need to prevent double encoding from properly
// escaped source data (such as & becoming &amp;).
$output
.
=
' <description>'
.
String
::
checkPlain
(
decode_entities
(
strip_tags
(
$description
)))
.
"</description>
\n
"
;
$output
.
=
' <language>'
.
String
::
checkPlain
(
$langcode
)
.
"</language>
\n
"
;
$output
.
=
format_xml_elements
(
$args
);
$output
.
=
$items
;
$output
.
=
"</channel>
\n
"
;
return
$output
;
}
/**
* Formats a single RSS item.
*
* Arbitrary elements may be added using the $args associative array.
*/
function
format_rss_item
(
$title
,
$link
,
$description
,
$args
=
array
())
{
$output
=
"<item>
\n
"
;
$output
.
=
' <title>'
.
String
::
checkPlain
(
$title
)
.
"</title>
\n
"
;
$output
.
=
' <link>'
.
check_url
(
$link
)
.
"</link>
\n
"
;
$output
.
=
' <description>'
.
String
::
checkPlain
(
$description
)
.
"</description>
\n
"
;
$output
.
=
format_xml_elements
(
$args
);
$output
.
=
"</item>
\n
"
;
return
$output
;
}
/**
* Formats XML elements.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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