404 Not Found
404 Artyku%C5%82u nie znaleziono
Tested on Joomla v3.4.8 and v3.6.2
Actual translation is Artykułu nie znaleziono, but HTTP status messages are ASCII-only.
The status code is using the Exception object's message, not a HTTP
standard message. So that's why.
There should be a map of status code: status message (at least for error codes used by Joomla) and JDocumentError should pick one here
Similar to how it's set in Slim\Http\Response
I'm not sure where to store the map. Should it be JErrorPage?
BTW: The HTTP reason phrase for 403 is Dost%C4%99p zabroniony
Make a Response
object that has these mappings. To save some work, just grab the data out of Symfony's Response object. Now there's a valid map for all known standard codes.
You could easily throw it in JResponse
; undeprecate the class (it was deprecated since we moved all of its existing logic to the web application class) and add the new logic there.
That works too. I didn't know if it had a hard reference to the redirect code or if it was "good enough" for general use off the top of my head.
There are actually more instances with misc entries:
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_redirect/models/fields/redirect.php#L38
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/application/web.php#L84
https://github.com/joomla/joomla-cms/blob/staging/libraries/vendor/joomla/application/src/AbstractWebApplication.php#L78
I'd love to split whole phrases like HTTP/1.1 300 Multiple Choices
in JApplicationWeb::$responseMap into protocol version, code and text just like in Symfony\Component\HttpFoundation\Response or Slim\Http\Response, make property public static and refactor JApplicationWeb::redirect method accordingly.
As ATM it's private, are there any reasons to not to do so?
Moreover what's the workflow?
Start with Joomla Framework Application AbstratWebApplication
then JApplicationWeb
and then adjust JDocumentError::render method?
Labels |
Added:
?
|
Category | ⇒ | Language & Strings |
Status | New | ⇒ | Confirmed |
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-27 01:44:08 |
Closed_By | ⇒ | mbabker |
@piotr-cz can you make a PR?