diff --git a/bin/noblogs.in b/bin/noblogs.in index 129bf4543c049568c9672b4cb84cc7117079b297..91cb7103957ab1eabb77f6e13618fdd6ecce6218 100755 --- a/bin/noblogs.in +++ b/bin/noblogs.in @@ -448,8 +448,9 @@ function add_https_to_uri($uri){ return preg_replace($re,$subst,$uri); } -// adds https to siteurl and home options +// adds https to siteurl and home options (and also flattrs custom image) function do_https_siteurl($args){ + $field_to_update = array('home', 'siteurl', 'flattrss_custom_image_url'); foreach ($args as $arg) { $blog = noblogs_get_blog($arg); if (!$blog) { @@ -458,16 +459,19 @@ function do_https_siteurl($args){ } 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); + foreach ($field_to_update as $field){ + $old = get_option($field); + if ( $old === false ){ + continue; + } + $new = add_https_to_uri($old); + if ($old === $new){ + continue; + } + update_option($field,$new); + } - echo "{$arg}: ${siteurl} | ${home}\n"; + echo "{$arg}\n"; restore_current_blog(); } }