Port javelin_tag() to master

Summary: I want to make FB code forwards compatible.

Test Plan: None.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4766
This commit is contained in:
vrana
2013-01-31 09:05:26 -08:00
parent e014b42e5a
commit 356c300086
2 changed files with 18 additions and 1 deletions

View File

@@ -1478,6 +1478,7 @@ phutil_register_library_map(array(
'celerity_get_resource_uri' => 'infrastructure/celerity/api.php',
'celerity_register_resource_map' => 'infrastructure/celerity/map.php',
'javelin_render_tag' => 'infrastructure/javelin/markup.php',
'javelin_tag' => 'infrastructure/javelin/markup.php',
'phabricator_date' => 'view/viewutils.php',
'phabricator_datetime' => 'view/viewutils.php',
'phabricator_format_bytes' => 'view/viewutils.php',

View File

@@ -1,10 +1,26 @@
<?php
/**
* @deprecated Use javelin_tag().
*/
function javelin_render_tag(
$tag,
array $attributes = array(),
$content = null) {
if (is_array($content)) {
$content = implode('', $content);
}
$html = javelin_tag($tag, $attributes, phutil_safe_html($content));
return $html->getHTMLContent();
}
function javelin_tag(
$tag,
array $attributes = array(),
$content = null) {
if (isset($attributes['sigil']) ||
isset($attributes['meta']) ||
isset($attributes['mustcapture'])) {
@@ -32,7 +48,7 @@ function javelin_render_tag(
}
}
return phutil_render_tag($tag, $attributes, $content);
return phutil_tag($tag, $attributes, $content);
}