Commit cf976bf
authored
Detect the tracked page URL from REQUEST_URI instead of PATH_INFO (#154)
* Detect the tracked page URL from REQUEST_URI, not PATH_INFO (#141)
getCurrentScriptName() builds the auto-detected page URL (the path
between host and query string). It preferred $_SERVER['PATH_INFO'],
which only holds the trailing path-info segment — so with front-
controller / path-info routing (e.g. /dir1/page handled by
dir1/index.php) the tracker recorded a truncated '/page' instead of
'/dir1/page'.
REQUEST_URI already contains the full requested path (PATH_INFO is
always just a suffix of it), so use it as the source and drop PATH_INFO
entirely; SCRIPT_NAME stays as the fallback when REQUEST_URI is absent.
This also aligns the primary source with Matomo core's Url helper.
Reported in #141.
* Drop the ticket number from an inline test comment
Keep issue references in the CHANGELOG and git history, not in code.1 parent b3e57c4 commit cf976bf
3 files changed
Lines changed: 26 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2621 | 2621 | | |
2622 | 2622 | | |
2623 | 2623 | | |
2624 | | - | |
2625 | | - | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
2626 | 2632 | | |
2627 | 2633 | | |
2628 | 2634 | | |
2629 | 2635 | | |
2630 | 2636 | | |
2631 | 2637 | | |
2632 | | - | |
2633 | | - | |
2634 | | - | |
2635 | | - | |
2636 | | - | |
2637 | | - | |
2638 | | - | |
2639 | | - | |
2640 | | - | |
2641 | | - | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
2642 | 2644 | | |
2643 | 2645 | | |
2644 | 2646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1848 | 1848 | | |
1849 | 1849 | | |
1850 | 1850 | | |
| 1851 | + | |
1851 | 1852 | | |
1852 | 1853 | | |
1853 | 1854 | | |
| 1855 | + | |
1854 | 1856 | | |
1855 | 1857 | | |
1856 | 1858 | | |
1857 | 1859 | | |
1858 | 1860 | | |
1859 | 1861 | | |
1860 | | - | |
1861 | | - | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
1862 | 1869 | | |
1863 | 1870 | | |
1864 | 1871 | | |
| |||
1871 | 1878 | | |
1872 | 1879 | | |
1873 | 1880 | | |
1874 | | - | |
| 1881 | + | |
| 1882 | + | |
1875 | 1883 | | |
1876 | 1884 | | |
1877 | 1885 | | |
| |||
0 commit comments