Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
customerror
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
customerror
Commits
49aca8ad
Commit
49aca8ad
authored
16 years ago
by
Khalid Baheyeldin
Browse files
Options
Downloads
Patches
Plain Diff
#405822
Was not sending 403/404 HTTP code in the headers
parent
2d236b47
Branches
Branches containing commit
Tags
6.x-1.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
customerror.module
+16
-3
16 additions, 3 deletions
customerror.module
with
16 additions
and
3 deletions
customerror.module
+
16
−
3
View file @
49aca8ad
...
...
@@ -147,9 +147,6 @@ function customerror_simpletest() {
drupal_get_path
(
'module'
,
'customerror'
)
.
'/tests'
,
'\.test$'
));
}
/**
* Implementation of hook_page().
*/
function
customerror_page
()
{
$code
=
arg
(
1
);
$_SESSION
[
'destination'
]
=
$_REQUEST
[
'destination'
];
...
...
@@ -157,7 +154,12 @@ function customerror_page() {
switch
(
$code
)
{
case
403
:
case
404
:
// Check if we should redirect
customerror_check_redirect
();
// Make sure that we sent an appropriate header
customerror_header
(
$code
);
drupal_set_title
(
variable_get
(
'customerror_'
.
$code
.
'_title'
,
_customerror_fetch_error
(
$code
)));
$output
=
theme
(
'customerror'
,
$code
,
variable_get
(
'customerror_'
.
$code
,
_customerror_fetch_error
(
$code
)));
$output
=
(
variable_get
(
'customerror_'
.
$code
.
'_php'
,
FALSE
))
?
drupal_eval
(
$output
)
:
$output
;
...
...
@@ -170,6 +172,17 @@ function customerror_page() {
return
$output
;
}
function
customerror_header
(
$code
)
{
switch
(
$code
)
{
case
403
:
drupal_set_header
(
'HTTP/1.1 403 Forbidden'
);
break
;
case
404
:
drupal_set_header
(
'HTTP/1.1 404 Not Found'
);
break
;
}
}
/**
* Implementation of hook_theme().
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment