diff options
author | Andrey Andreev <narf@devilix.net> | 2016-12-01 14:18:46 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-12-01 14:18:46 +0100 |
commit | 5e47aa3d87b44627bd79850536bfacd8d39a92a6 (patch) | |
tree | da4c5f9470566add053b96b08e782c55c1f55659 | |
parent | 0c84ef9a33d18d758e36447fd18a240a458ae2bc (diff) |
Remove previously deprecated HTML helper functions br(), nbs()
-rw-r--r-- | system/helpers/html_helper.php | 34 | ||||
-rw-r--r-- | tests/codeigniter/helpers/html_helper_test.php | 16 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 3 | ||||
-rw-r--r-- | user_guide_src/source/helpers/html_helper.rst | 40 | ||||
-rw-r--r-- | 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('<br />', $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 /><br />', br(2)); - } - - // ------------------------------------------------------------------------ - public function test_heading() { $this->assertEquals('<h1>foobar</h1>', 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 <libraries/config>` method ``system_url()`` (encourages insecure practices). - Removed previously deprecated :doc:`Date Helper <helpers/date_helper>` function ``standard_date()`` (use PHP's native ``date()`` instead). - Removed previously deprecated :doc:`Security Helper <helpers/security_helper>` function ``do_hash()`` (use PHP's native ``hash()`` instead). + - Removed previously deprecated :doc:`HTML Helper <helpers/html_helper>` functions ``br()`` and ``nbs()`` (use PHP's native ``str_repeat()`` with ``'<br />'`` 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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> XHTML+RDFa 1.1 xhtml-rdfa-2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"> =============================== =================== ================================================================================================================================================== - -.. 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 (<br />) based on the number you submit. - Example:: - - echo br(3); - - The above would produce: - - .. code-block:: html - - <br /><br /><br /> - - .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` - in combination with ``<br />`` 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 ``'<br />'`` instead) +- ``nbs()`` :doc:`HTML Helper <../helpers/html_helper>` function (use ``str_repeat()`` with ``' '`` instead) - The entire *Email Helper*, which only had two functions: |