Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
noblogs-wp-ssl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Noblogs
noblogs-wp-ssl
Commits
62f5ff57
Commit
62f5ff57
authored
8 years ago
by
lucha
Browse files
Options
Downloads
Patches
Plain Diff
rewrite links regex
parent
0b6389fe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
noblogs-wp-ssl.php
+5
-5
5 additions, 5 deletions
noblogs-wp-ssl.php
with
5 additions
and
5 deletions
noblogs-wp-ssl.php
+
5
−
5
View file @
62f5ff57
...
...
@@ -19,7 +19,7 @@ if ( !function_exists('add_action') ) {
function
rewrite_links
(
$buffer
)
{
// replace href or src attributes within script, link, base, and img tags with just "//" for protocol
$re
=
"
/
(<(?:script|link|base|img|form|a)(?:[^>]*)(?:href|src|action)=[
\"
'])http:
\\
/
\\
/([^.]+\.noblogs\.org)
/
i"
;
$re
=
"
#
(<(?:script|link|base|img|form|a)(?:[^>]*)(?:href|src|action)=[
\"
'])http:
/
/([^.]+\.noblogs\.org)
#
i"
;
$subst
=
"$1https://$2"
;
return
preg_replace
(
$re
,
$subst
,
$buffer
);
}
...
...
@@ -30,7 +30,7 @@ function noblogs_wp_ssl_buffer_wrapup($buffer) {
if
(
empty
(
$_SERVER
[
'HTTPS'
]))
{
return
$buffer
;
}
// Check for a Content-Type header. Currently only apply rewriting to "text/html" or undefined
$headers
=
headers_list
();
$content_type
=
null
;
...
...
@@ -51,11 +51,11 @@ function noblogs_wp_ssl_buffer_wrapup($buffer) {
$buffer
=
$return
;
}
}
return
$buffer
;
return
$buffer
;
}
// This is a filter function that act on the post $content
// This is a filter function that act on the post $content
function
noblogs_wp_ssl_content_filter
(
$content
)
{
// skip rewrite if not on HTTPS
if
(
empty
(
$_SERVER
[
'HTTPS'
]))
{
...
...
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