Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linkchecker-3247797
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
linkchecker-3247797
Commits
5134f949
Commit
5134f949
authored
13 years ago
by
Alexander Hass
Browse files
Options
Downloads
Patches
Plain Diff
#1429284
: Followup - Only follow one redirect
parent
7f581deb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
linkchecker.module
+10
-16
10 additions, 16 deletions
linkchecker.module
with
10 additions
and
16 deletions
linkchecker.module
+
10
−
16
View file @
5134f949
...
...
@@ -222,25 +222,19 @@ function _linkchecker_status_handling($link, $response) {
$useragent
=
variable_get
(
'linkchecker_check_useragent'
,
'Drupal (+http://drupal.org/)'
);
$ignore_response_codes
=
preg_split
(
'/(\r\n?|\n)/'
,
variable_get
(
'linkchecker_ignore_response_codes'
,
"200
\n
206
\n
302
\n
304
\n
401
\n
403"
));
//
FIXME: drupal_http_request() may not provide an UTF8 encoded error message
//
what results in a database UPDATE failure. See http://drupal.org/node/371495
//
for more information. ISO-8859-1 as source encoding may be wr
on
g
,
but WFM.
if
(
!
empty
(
$response
->
error
)
&&
!
drupal_validate_utf8
(
$response
->
error
))
{
$response
->
error
=
drupal_convert_to_utf8
(
$response
->
error
,
'ISO-8859-1'
);
}
//
Prevent E_ALL warnings for non-existing $response->error
.
if
(
!
isset
(
$response
->
error
))
{
$response
->
error
=
''
;
//
- Prevent E_ALL warnings in DB updates for non-existing $response->error.
//
- @todo drupal_http_request() may not provide an UTF8 encoded error message
//
what results in a database UPDATE failure. For more informati
on,
see
// http://drupal.org/node/371495.
// Workaround: ISO-8859-1 as source encoding may be wrong, but WFM.
$response
->
error
=
trim
(
drupal_convert_to_utf8
(
$errstr
,
'ISO-8859-1'
));
//
Make response object consistent with HTTPRL
.
if
(
$response
->
code
==
301
&&
!
isset
(
$response
->
redirect_code
))
{
$response
->
redirect_code
=
$response
->
code
;
}
switch
(
$response
->
code
)
{
case
200
:
case
206
:
db_query
(
"UPDATE
{
linkchecker_links
}
SET code = %d, error = '%s', fail_count = %d, last_checked = %d WHERE lid = %d"
,
$response
->
code
,
$response
->
error
,
0
,
time
(),
$link
->
lid
);
//watchdog('linkchecker', 'Checked %link successfully.', array('%link' => $link->url), WATCHDOG_INFO);
break
;
case
301
:
db_query
(
"UPDATE
{
linkchecker_links
}
SET code = %d, error = '%s', fail_count = fail_count+1, last_checked = %d WHERE lid = %d"
,
$response
->
code
,
$response
->
error
,
time
(),
$link
->
lid
);
...
...
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