]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Deprecate phutil_escape_html()
authorvrana <jakubv@fb.com>
Sat, 9 Feb 2013 23:04:20 +0000 (15:04 -0800)
committervrana <jakubv@fb.com>
Sat, 9 Feb 2013 23:18:19 +0000 (15:18 -0800)
Summary:
My original idea was to return safe HTML from this function.
But we are down to 20 occurrences in Phabricator and you shouldn't need this function in safe HTML world at all.

Test Plan:
  $ arc lint src/applications/audit/controller/PhabricatorAuditListController.php

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4890

src/lint/linter/ArcanistPhutilXHPASTLinter.php

index 1a50300a66a271a132d1839556f714a754e349d1..9a0e9d47ba4d89a2ac74e21f14ddd9967922c948 100644 (file)
@@ -30,7 +30,7 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
     return array(
       self::LINT_PHT_WITH_DYNAMIC_STRING => 'Use of pht() on Dynamic String',
       self::LINT_ARRAY_COMBINE           => 'array_combine() Unreliable',
-      self::LINT_DEPRECATED_FUNCTION     => 'Use of deprecated function',
+      self::LINT_DEPRECATED_FUNCTION     => 'Use of Deprecated Function',
       self::LINT_UNSAFE_DYNAMIC_STRING   => 'Unsafe Usage of Dynamic String',
     );
   }
@@ -198,6 +198,10 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
       'phabricator_render_form' =>
         'The phabricator_render_form() function is deprecated and unsafe. '.
         'Use phabricator_form() instead.',
+
+      'phutil_escape_html' =>
+        'The phutil_escape_html() function is deprecated. Raw strings passed '.
+        'to phutil_tag() or hsprintf() are escaped automatically.',
     );
 
     $function_calls = $root->selectDescendantsOfType('n_FUNCTION_CALL');