From aa576af4347b1bde1268b10b34ad2d906ccde8b8 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 18 Jul 2013 13:30:25 -0700 Subject: [PATCH] Remove deprecated javelin_render_tag() and phabricator_render_form() Summary: Not removing `phutil_render_tag()` for now as it is still used in Diviner. @edward, please verify Facebook callsites. Test Plan: Searched for it. Reviewers: edward, epriestley Reviewed By: epriestley CC: aran, Korvin, wez Differential Revision: https://secure.phabricator.com/D6494 --- src/__phutil_library_map__.php | 2 -- src/docs/developer/rendering_html.diviner | 15 ++++------ src/infrastructure/javelin/markup.php | 30 ------------------- .../lint/PhabricatorLintEngine.php | 8 ----- 4 files changed, 5 insertions(+), 50 deletions(-) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 4b6a7aa381..0ce39da0fd 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1947,7 +1947,6 @@ phutil_register_library_map(array( 'celerity_register_resource_map' => 'infrastructure/celerity/map.php', 'implode_handle_links' => 'applications/phid/handle/view/render.php', 'implode_selected_handle_links' => 'applications/phid/handle/view/render.php', - 'javelin_render_tag' => 'infrastructure/javelin/markup.php', 'javelin_tag' => 'infrastructure/javelin/markup.php', 'phabricator_date' => 'view/viewutils.php', 'phabricator_datetime' => 'view/viewutils.php', @@ -1960,7 +1959,6 @@ phutil_register_library_map(array( 'phabricator_on_relative_date' => 'view/viewutils.php', 'phabricator_parse_bytes' => 'view/viewutils.php', 'phabricator_relative_date' => 'view/viewutils.php', - 'phabricator_render_form' => 'infrastructure/javelin/markup.php', 'phabricator_time' => 'view/viewutils.php', 'phid_get_subtype' => 'applications/phid/utils.php', 'phid_get_type' => 'applications/phid/utils.php', diff --git a/src/docs/developer/rendering_html.diviner b/src/docs/developer/rendering_html.diviner index 6fa6a21df2..e1b1d679a3 100644 --- a/src/docs/developer/rendering_html.diviner +++ b/src/docs/developer/rendering_html.diviner @@ -23,8 +23,7 @@ from XSS and render correctly. Broadly: - @{class:AphrontView} subclasses act like tags when rendering. - @{function:pht} has some special rules. - There are some other things that you should be aware of. - - Do not use @{function:phutil_render_tag} or @{function:javelin_render_tag}, - they are deprecated and unsafe. + - Do not use @{function:phutil_render_tag}, it is deprecated and unsafe. See below for discussion. @@ -185,11 +184,7 @@ following examples are dangerous: = Deprecated Functions = -The functions @{function@libphutil:phutil_render_tag} and -@{function:javelin_render_tag} are unsafe versions of -@{function@libphutil:phutil_tag} and @{function:javelin_tag}, are deprecated, -and will be removed in the future. You should avoid their use and convert code -to use @{function@libphutil:phutil_tag} and @{function:javelin_tag}. - -The function @{function:phabricator_render_form} is also deprecated, in favor of -@{function:phabricator_form}. +The function @{function@libphutil:phutil_render_tag} is unsafe version of +@{function@libphutil:phutil_tag}, is deprecated, and will be removed in the +future. You should avoid its use and convert code to use +@{function@libphutil:phutil_tag}. diff --git a/src/infrastructure/javelin/markup.php b/src/infrastructure/javelin/markup.php index 1dc8c1a036..5477f5687b 100644 --- a/src/infrastructure/javelin/markup.php +++ b/src/infrastructure/javelin/markup.php @@ -1,21 +1,5 @@ getHTMLContent(); -} - function javelin_tag( $tag, array $attributes = array(), @@ -81,17 +65,3 @@ function phabricator_form(PhabricatorUser $user, $attributes, $content) { return javelin_tag('form', $attributes, $body); } - - -/** - * @deprecated - */ -function phabricator_render_form(PhabricatorUser $user, $attributes, $content) { - if (is_array($content)) { - $content = implode('', $content); - } - - $html = phabricator_form($user, $attributes, phutil_safe_html($content)); - return $html->getHTMLContent(); -} - diff --git a/src/infrastructure/lint/PhabricatorLintEngine.php b/src/infrastructure/lint/PhabricatorLintEngine.php index 1b247698f8..37722ba991 100644 --- a/src/infrastructure/lint/PhabricatorLintEngine.php +++ b/src/infrastructure/lint/PhabricatorLintEngine.php @@ -14,14 +14,6 @@ class PhabricatorLintEngine extends PhutilLintEngine { 'phutil_escape_html' => 'The phutil_escape_html() function is deprecated. Raw strings '. 'passed to phutil_tag() or hsprintf() are escaped automatically.', - - 'javelin_render_tag' => - 'The javelin_render_tag() function is deprecated and unsafe. '. - 'Use javelin_tag() instead.', - - 'phabricator_render_form' => - 'The phabricator_render_form() function is deprecated and unsafe. '. - 'Use phabricator_form() instead.', )); } }