From 5e47aa3d87b44627bd79850536bfacd8d39a92a6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Dec 2016 15:18:46 +0200 Subject: Remove previously deprecated HTML helper functions br(), nbs() --- system/helpers/html_helper.php | 34 ------------------ tests/codeigniter/helpers/html_helper_test.php | 16 +-------- user_guide_src/source/changelog.rst | 3 +- user_guide_src/source/helpers/html_helper.rst | 40 ---------------------- user_guide_src/source/installation/upgrade_320.rst | 2 ++ 5 files changed, 5 insertions(+), 90 deletions(-) diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index 696f0eee2..22ef39c2e 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -389,37 +389,3 @@ if ( ! function_exists('meta')) return $str; } } - -// ------------------------------------------------------------------------ - -if ( ! function_exists('br')) -{ - /** - * Generates HTML BR tags based on number supplied - * - * @deprecated 3.0.0 Use str_repeat() instead - * @param int $count Number of times to repeat the tag - * @return string - */ - function br($count = 1) - { - return str_repeat('
', $count); - } -} - -// ------------------------------------------------------------------------ - -if ( ! function_exists('nbs')) -{ - /** - * Generates non-breaking space entities based on number supplied - * - * @deprecated 3.0.0 Use str_repeat() instead - * @param int - * @return string - */ - function nbs($num = 1) - { - return str_repeat(' ', $num); - } -} diff --git a/tests/codeigniter/helpers/html_helper_test.php b/tests/codeigniter/helpers/html_helper_test.php index 029f3f4cd..5565e011b 100644 --- a/tests/codeigniter/helpers/html_helper_test.php +++ b/tests/codeigniter/helpers/html_helper_test.php @@ -9,13 +9,6 @@ class Html_helper_test extends CI_TestCase { // ------------------------------------------------------------------------ - public function test_br() - { - $this->assertEquals('

', br(2)); - } - - // ------------------------------------------------------------------------ - public function test_heading() { $this->assertEquals('

foobar

', heading('foobar')); @@ -72,13 +65,6 @@ EOH; // ------------------------------------------------------------------------ - public function test_NBS() - { - $this->assertEquals('   ', nbs(3)); - } - - // ------------------------------------------------------------------------ - public function test_meta() { $this->assertEquals( @@ -101,4 +87,4 @@ EOH; meta(array('name' => 'foo', 'type' => 'charset')) ); } -} \ No newline at end of file +} diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index ba11fe1c8..33f25db51 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -15,6 +15,7 @@ Release Date: Not Released - Removed previously deprecated :doc:`Config Library ` method ``system_url()`` (encourages insecure practices). - Removed previously deprecated :doc:`Date Helper ` function ``standard_date()`` (use PHP's native ``date()`` instead). - Removed previously deprecated :doc:`Security Helper ` function ``do_hash()`` (use PHP's native ``hash()`` instead). + - Removed previously deprecated :doc:`HTML Helper ` functions ``br()`` and ``nbs()`` (use PHP's native ``str_repeat()`` with ``'
'`` and ``' '`` respectively). - Removed previously deprecated *Email Helper* (had only two functions, aliases for PHP's native ``filter_var()`` and ``mail()``). - Libraries @@ -3501,7 +3502,7 @@ Release Date: March 10, 2006 - Fixed a pagination problem in the scaffolding. - Fixed a bug in the mysql class "where" function. - Fixed a regex problem in some code that trimmed duplicate slashes. -- Fixed a bug in the br() function in the HTML helper +- Fixed a bug in the ``br()`` function in the HTML helper - Fixed a syntax mistake in the form_dropdown function in the Form Helper. - Removed the "style" attributes form the form helpers. diff --git a/user_guide_src/source/helpers/html_helper.rst b/user_guide_src/source/helpers/html_helper.rst index b4e56fdca..734b4465c 100644 --- a/user_guide_src/source/helpers/html_helper.rst +++ b/user_guide_src/source/helpers/html_helper.rst @@ -371,43 +371,3 @@ The following functions are available: XHTML+RDFa 1.0 xhtml-rdfa-1 XHTML+RDFa 1.1 xhtml-rdfa-2 =============================== =================== ================================================================================================================================================== - -.. php:function:: br([$count = 1]) - - :param int $count: Number of times to repeat the tag - :returns: HTML line break tag - :rtype: string - - Generates line break tags (
) based on the number you submit. - Example:: - - echo br(3); - - The above would produce: - - .. code-block:: html - -


- - .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` - in combination with ``
`` instead. - -.. php:function:: nbs([$num = 1]) - - :param int $num: Number of space entities to produce - :returns: A sequence of non-breaking space HTML entities - :rtype: string - - Generates non-breaking spaces ( ) based on the number you submit. - Example:: - - echo nbs(3); - - The above would produce: - - .. code-block:: html - -     - - .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` - in combination with `` `` instead. diff --git a/user_guide_src/source/installation/upgrade_320.rst b/user_guide_src/source/installation/upgrade_320.rst index 080a02895..a357e20ef 100644 --- a/user_guide_src/source/installation/upgrade_320.rst +++ b/user_guide_src/source/installation/upgrade_320.rst @@ -139,6 +139,8 @@ version 3.0.0, that have been removed in 3.2.0: - ``standard_date()`` :doc:`Date Helper <../helpers/date_helper>` function (use ``date()`` instead) - ``do_hash()`` :doc:`Security Helper <../helpers/security_helper>` function (use ``hash()`` instead) +- ``br()`` :doc:`HTML Helper <../helpers/html_helper>` function (use ``str_repeat()`` with ``'
'`` instead) +- ``nbs()`` :doc:`HTML Helper <../helpers/html_helper>` function (use ``str_repeat()`` with ``' '`` instead) - The entire *Email Helper*, which only had two functions: -- cgit v1.2.3-24-g4f1b