" /> <link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?> /favicon.ico" /> <title><?php echo ucfirst(get_userdata($pb_user_id)->user_login); _e('\'s Catalog Page', 'pressbooks'); ?> | PressBooks</title> <link rel="stylesheet" type="text/css" href="<?php echo PB_PLUGIN_URL; ?> assets/css/style-catalog.css?ver=2" /> <link href='<?php echo \PressBooks\Sanitize\maybe_https('http://fonts.googleapis.com/css?family=Oswald|Open+Sans:400,400italic,600'); ?> ' rel='stylesheet' type='text/css'> <script type="text/javascript" src="<?php echo network_site_url('/wp-includes/js/jquery/jquery.js?ver=1.10.2'); ?> "></script> <script src="<?php echo PB_PLUGIN_URL; ?> symbionts/jquery/jquery.equalizer.min.js?ver=1.2.5" type="text/javascript"></script> <script src="<?php echo PB_PLUGIN_URL; ?> symbionts/jquery/isotope.pkgd.min.js?ver=2.1.0" type="text/javascript"></script> <script src="<?php
/** * @covers \PressBooks\Sanitize\maybe_https */ public function test_maybe_https() { if (isset($_SERVER['HTTPS'])) { $old = $_SERVER['HTTPS']; } $_SERVER['HTTPS'] = true; $url = 'http://pressbooks.com'; $url = \PressBooks\Sanitize\maybe_https($url); $this->assertStringStartsWith('https://', $url); $url = 'http://https.org'; $url = \PressBooks\Sanitize\maybe_https($url); $this->assertEquals('https://https.org', $url); $_SERVER['HTTPS'] = false; $url = 'http://pressbooks.com'; $url = \PressBooks\Sanitize\maybe_https($url); $this->assertStringStartsNotWith('https://', $url); $url = 'https://http.org'; $url = \PressBooks\Sanitize\maybe_https($url); $this->assertEquals('https://http.org', $url); if (isset($old)) { $_SERVER['HTTPS'] = $old; } else { unset($_SERVER['HTTPS']); } }