Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
noblogs-cli
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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-cli
Commits
439a3c03
There was a problem fetching the pipeline summary.
Commit
439a3c03
authored
8 years ago
by
lucha
Browse files
Options
Downloads
Patches
Plain Diff
replace http with https in siteurl and home options
parent
41bed9d1
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/noblogs.in
+33
-1
33 additions, 1 deletion
bin/noblogs.in
with
33 additions
and
1 deletion
bin/noblogs.in
+
33
−
1
View file @
439a3c03
...
...
@@ -72,6 +72,9 @@ Known commands:
Convert Next Gen Gallery (NGG) photo galleries to stardard Wordpress
galleries, and then notify (via email) admins of the fact.
https-siteurl BLOG
Adds https (instead of http) to siteurl and home options.
<?php
exit
(
1
);
}
...
...
@@ -435,6 +438,36 @@ function do_ngg_convert($args) {
}
}
// replaces http with https, and removes ending slash
function
add_https_to_uri
(
$uri
){
$re
=
"http[s]?:\/\/([^.]+\.noblogs\.org)[/]?/i"
;
$subst
=
"https://$1"
;
return
preg_replace
(
$re
,
$subst
,
$uri
);
}
// adds https to siteurl and home options
function
do_https_siteurl
(
$args
){
foreach
(
$args
as
$arg
)
{
$blog
=
noblogs_get_blog
(
$arg
);
if
(
!
$blog
)
{
echo
"Blog
{
$arg
}
not found.
\n
"
;
continue
;
}
switch_to_blog
(
$blog
->
blog_id
);
$siteurl
=
get_option
(
'siteurl'
);
$home
=
get_option
(
'home'
);
$siteurl
=
add_https_to_uri
(
$siteurl
);
$home
=
add_https_to_uri
(
$home
);
update_option
(
'siteurl'
,
$siteurl
);
update_option
(
'home'
,
$home
);
echo
"
{
$arg
}
: ${siteurl} | ${home}
\n
"
;
restore_current_blog
();
}
}
// Command-line parsing.
$cmd
=
$argv
[
1
];
...
...
@@ -448,4 +481,3 @@ if (!function_exists($cmd_func)) {
help
();
}
call_user_func
(
$cmd_func
,
array_slice
(
$argv
,
2
));
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