Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
1a3f6448
Commit
1a3f6448
authored
Jan 27, 2006
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #2013: improved XHTML conformance of error messages
o Some of the error messages did not close '<p>' tags.
parent
fd51c3e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/ZPublisher/HTTPResponse.py
lib/python/ZPublisher/HTTPResponse.py
+7
-6
No files found.
doc/CHANGES.txt
View file @
1a3f6448
...
@@ -197,6 +197,9 @@ Zope Changes
...
@@ -197,6 +197,9 @@ Zope Changes
Bugs Fixed
Bugs Fixed
- Collector #2013: improved XHTML conformance of error messages,
some of which did not close '<p>' tags.
- Collector #2002: fixed broken 'ls -R' functionality (didn't
- Collector #2002: fixed broken 'ls -R' functionality (didn't
recurse properly subclasses of OFS.Folder)
recurse properly subclasses of OFS.Folder)
...
...
lib/python/ZPublisher/HTTPResponse.py
View file @
1a3f6448
...
@@ -679,7 +679,7 @@ class HTTPResponse(BaseResponse):
...
@@ -679,7 +679,7 @@ class HTTPResponse(BaseResponse):
raise
NotFound
,
self
.
_error_html
(
raise
NotFound
,
self
.
_error_html
(
"Debugging Notice"
,
"Debugging Notice"
,
"Zope has encountered a problem publishing your object.<p>"
"Zope has encountered a problem publishing your object.<p>"
"
\
n
%s"
%
entry
)
"
\
n
%s
</p>
"
%
entry
)
def
badRequestError
(
self
,
name
):
def
badRequestError
(
self
,
name
):
self
.
setStatus
(
400
)
self
.
setStatus
(
400
)
...
@@ -693,7 +693,7 @@ class HTTPResponse(BaseResponse):
...
@@ -693,7 +693,7 @@ class HTTPResponse(BaseResponse):
"The parameter, <em>%s</em>, "
%
name
+
"The parameter, <em>%s</em>, "
%
name
+
"was omitted from the request.<p>"
+
"was omitted from the request.<p>"
+
"Make sure to specify all required parameters, "
+
"Make sure to specify all required parameters, "
+
"and try the request again."
"and try the request again.
</p>
"
)
)
def
_unauthorized
(
self
):
def
_unauthorized
(
self
):
...
@@ -706,9 +706,9 @@ class HTTPResponse(BaseResponse):
...
@@ -706,9 +706,9 @@ class HTTPResponse(BaseResponse):
m
=
"<strong>You are not authorized to access this resource.</strong>"
m
=
"<strong>You are not authorized to access this resource.</strong>"
if
self
.
debug_mode
:
if
self
.
debug_mode
:
if
self
.
_auth
:
if
self
.
_auth
:
m
=
m
+
'<p>
\
n
Username and password are not correct.'
m
=
m
+
'<p>
\
n
Username and password are not correct.
</p>
'
else
:
else
:
m
=
m
+
'<p>
\
n
No Authorization header found.'
m
=
m
+
'<p>
\
n
No Authorization header found.
</p>
'
raise
Unauthorized
,
m
raise
Unauthorized
,
m
def
exception
(
self
,
fatal
=
0
,
info
=
None
,
def
exception
(
self
,
fatal
=
0
,
info
=
None
,
...
@@ -798,7 +798,7 @@ class HTTPResponse(BaseResponse):
...
@@ -798,7 +798,7 @@ class HTTPResponse(BaseResponse):
if fatal and t is SystemExit and v.code == 0:
if fatal and t is SystemExit and v.code == 0:
body = self.setBody(
body = self.setBody(
(str(t),
(str(t),
'
Zope
has
exited
normally
.
<
p
>
' + self._traceback(t, v, tb)),
'
Zope
has
exited
normally
.
<
p
>
' + self._traceback(t, v, tb)
+ '
</
p
>
'
),
is_error=1)
is_error=1)
else:
else:
try:
try:
...
@@ -809,7 +809,8 @@ class HTTPResponse(BaseResponse):
...
@@ -809,7 +809,8 @@ class HTTPResponse(BaseResponse):
body = self.setBody(
body = self.setBody(
(str(t),
(str(t),
'
Sorry
,
a
site
error
occurred
.
<
p
>
'
'
Sorry
,
a
site
error
occurred
.
<
p
>
'
+ self._traceback(t, v, tb)),
+ self._traceback(t, v, tb)
+ '
</
p
>
'),
is_error=1)
is_error=1)
elif self.isHTML(b):
elif self.isHTML(b):
# error is an HTML document, not just a snippet of html
# error is an HTML document, not just a snippet of html
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment