Skip to content

Commit 2be50cc

Browse files
authored
Merge pull request #7356 from kenjis/docs-fix-uri_string-432-bc
docs: add uri_string() BC in v4.3.2
2 parents dbe1ac8 + a853148 commit 2be50cc

5 files changed

Lines changed: 36 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
### Breaking Changes
77

88
* fix: base_url() removes trailing slash in baseURL by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7200
9+
* fix: remove parameter $relative in `uri_string()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7135
910

1011
### Fixed Bugs
1112

@@ -14,7 +15,6 @@
1415
* fix: remove `All` from `Options All -Indexes` in .htaccess by @sba in https://github.com/codeigniter4/CodeIgniter4/pull/7093
1516
* fix: bug on stuck content-type header in Feature Testing by @baycik in https://github.com/codeigniter4/CodeIgniter4/pull/7112
1617
* fix: ordering `Validation` show error by call `setRule()` by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/7149
17-
* fix: remove parameter $relative in `uri_string()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7135
1818
* fix: [QueryBuilder] where() generates incorrect SQL when using RawSql by @sclubricants in https://github.com/codeigniter4/CodeIgniter4/pull/7147
1919
* fix: [QueryBuilder] RawSql passed to set() disappears without error by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7148
2020
* fix: [Parser] local_currency causes "Passing null to parameter" by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7157

user_guide_src/source/changelogs/v4.3.2.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,21 @@ Behavior Changes
1818
base_url()
1919
----------
2020

21-
Due to a bug, in previous versions :php:func:`base_url()` without argument returned baseURL
22-
without a trailing slash (``/``) like ``http://localhost:8080``. Now it returns
23-
baseURL with a trailing slash. This is the same behavior as ``base_url()`` in
24-
CodeIgniter 3.
21+
- Due to a bug, in previous versions :php:func:`base_url()` without argument
22+
returned baseURL without a trailing slash (``/``) like ``http://localhost:8080``.
23+
- Now it returns baseURL with a trailing slash. This is the same behavior as
24+
``base_url()`` in CodeIgniter 3.
2525

26-
Changes
27-
*******
26+
.. _v432-uri-string:
27+
28+
uri_string()
29+
------------
2830

2931
- The parameter ``$relative`` in :php:func:`uri_string()` was removed. Due to a bug,
30-
the function always returned a path relative to baseURL. No behavior changes.
32+
the function always returned a path relative to baseURL.
33+
- When baseURL is accessed, it will now return an empty string (``''``). This is
34+
the same behavior as ``uri_string()`` in CodeIgniter 3. In previous versions
35+
it returned ``/``.
3136

3237
Bugs Fixed
3338
**********

user_guide_src/source/changelogs/v4.3.3.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Bugs Fixed
3333

3434
- **Config:** Added missing ``Config\Encryption::$cipher``.
3535
- **UserGuide:** Fixed the sample code for :ref:`encryption-compatible-with-ci3`.
36+
- **UserGuide:** Added a missing breaking change in ``uri_string()`` in
37+
:ref:`ChangeLog <v432-uri-string>` and
38+
:ref:`Upgrading Guide <upgrade-432-uri-string>` v4.3.2.
3639

3740
See the repo's
3841
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_

user_guide_src/source/helpers/url_helper.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ The following functions are available:
155155
However, due to a bug, this function always returned a path relative to baseURL.
156156
Since v4.3.2, the parameter has been removed.
157157

158+
.. note:: In previous versions, when you navigate to the baseURL, this function
159+
returned ``/``. Since v4.3.2, the bug has been fixed and it returns an
160+
empty string(``''``).
161+
158162
.. php:function:: index_page([$altConfig = null])
159163
160164
:param \\Config\\App $altConfig: Alternate configuration to use

user_guide_src/source/installation/upgrade_432.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Breaking Changes
1818
base_url()
1919
==========
2020

21-
The :php:func:`base_url()` behavior has been fix. In previous versions, when you
21+
The :php:func:`base_url()` behavior has been fixed. In previous versions, when you
2222
call ``base_url()`` **without argument**, it returned baseURL without a trailing
2323
slash (``/``). Now it returns baseURL with a trailing slash. For example:
2424

@@ -27,6 +27,21 @@ slash (``/``). Now it returns baseURL with a trailing slash. For example:
2727

2828
If you have code to call ``base_url()`` without argument, you may need to adjust the URLs.
2929

30+
.. _upgrade-432-uri-string:
31+
32+
uri_string()
33+
============
34+
35+
The :php:func:`uri_string()` behavior has been fixed. In previous versions, when you
36+
navigate to the baseURL, it returned ``/``. Now it returns an empty string (``''``).
37+
38+
If you have code to call ``uri_string()``, you may need to adjust it.
39+
40+
.. note:: The :php:func:`uri_string()` returns a URI path relative to baseURL.
41+
It is not a full URI path if the baseURL contains subfolders.
42+
If you use it for HTML links, it is better to use it with :php:func:`site_url()`
43+
like ``site_url(uri_string())``.
44+
3045
Mandatory File Changes
3146
**********************
3247

0 commit comments

Comments
 (0)