Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up possible PHP Notices.

  • Loading branch information...
commit 3ec003b2587d9b6ffde7cbefd36172aba0453df4 1 parent 6aa0024
@mvied authored
2  lib/Mvied
@@ -1 +1 @@
-Subproject commit ee1485e08a809c8ccb555c400577619e5e55cde9
+Subproject commit e4869017206c89b78700593a62e1cbee266b5409
View
3  lib/WordPressHTTPS/Module/Core.php
@@ -545,10 +545,11 @@ public function set_headers() {
* @return void
*/
public function set_cookie($cookie, $expire, $expiration, $user_id, $scheme) {
+ $secure = null;
if ( ( $scheme == 'secure_auth' && $this->getPlugin()->isSsl() ) || ( ( ( defined('FORCE_SSL_ADMIN') && constant('FORCE_SSL_ADMIN') ) || $this->getPlugin()->getSetting('ssl_admin') ) && ! $this->getPlugin()->getSetting('ssl_host_subdomain') ) ) {
$secure = true;
}
- $secure = apply_filters('secure_auth_cookie', @$secure, $user_id);
+ $secure = apply_filters('secure_auth_cookie', $secure, $user_id);
if( $scheme == 'logged_in' ) {
$cookie_name = LOGGED_IN_COOKIE;
View
6 lib/WordPressHTTPS/Module/Post.php
@@ -65,7 +65,7 @@ public function post_save( $post_id ) {
return $post_id;
}
- if ( @$_POST['post_type'] == 'page' ) {
+ if ( isset($_POST['post_type']) && $_POST['post_type'] == 'page' ) {
if ( !current_user_can('edit_page', $post_id) ) {
return $post_id;
}
@@ -75,14 +75,14 @@ public function post_save( $post_id ) {
}
}
- $force_ssl = ( @$_POST['force_ssl'] == 1 ? true : false);
+ $force_ssl = ( isset($_POST['force_ssl']) && $_POST['force_ssl'] == 1 ? true : false);
if ( $force_ssl ) {
update_post_meta($post_id, 'force_ssl', 1);
} else {
delete_post_meta($post_id, 'force_ssl');
}
- $force_ssl_children = ( @$_POST['force_ssl_children'] == 1 ? true : false);
+ $force_ssl_children = ( isset($_POST['force_ssl_children']) && $_POST['force_ssl_children'] == 1 ? true : false);
if ( $force_ssl_children ) {
update_post_meta($post_id, 'force_ssl_children', 1);
} else {
View
12 lib/WordPressHTTPS/Module/UrlMapping.php
@@ -43,11 +43,11 @@ public function init() {
public function map_http_url( $url ) {
if ( is_array($this->getPlugin()->getSetting('ssl_host_mapping')) && sizeof($this->getPlugin()->getSetting('ssl_host_mapping')) > 0 ) {
foreach( $this->getPlugin()->getSetting('ssl_host_mapping') as $mapping ) {
- if ( !is_array($mapping) || @$mapping[1]['scheme'] != 'http' ) {
+ if ( !is_array($mapping) || ( isset($mapping[1]['scheme']) && $mapping[1]['scheme'] != 'http' ) ) {
continue;
}
- $http_url = 'http://' . @$mapping[1]['host'];
- $https_url = 'https://' . @$mapping[0]['host'];
+ $http_url = 'http://' . ( isset($mapping[1]['host']) ? $mapping[1]['host'] : '' );
+ $https_url = 'https://' . ( isset($mapping[0]['host']) ? $mapping[0]['host'] : '' );
preg_match('|' . $https_url . '|', $url, $matches);
if ( sizeof($matches) > 0 ) {
$url = preg_replace('|' . $https_url . '|', $http_url, $url);
@@ -66,11 +66,11 @@ public function map_http_url( $url ) {
public function map_https_url( $url ) {
if ( is_array($this->getPlugin()->getSetting('ssl_host_mapping')) && sizeof($this->getPlugin()->getSetting('ssl_host_mapping')) > 0 ) {
foreach( $this->getPlugin()->getSetting('ssl_host_mapping') as $mapping ) {
- if ( !is_array($mapping) || @$mapping[1]['scheme'] != 'https' ) {
+ if ( !is_array($mapping) || ( isset($mapping[1]['scheme']) && $mapping[1]['scheme'] != 'https' ) ) {
continue;
}
- $http_url = 'http://' . @$mapping[0]['host'];
- $https_url = 'https://' . @$mapping[1]['host'];
+ $http_url = 'http://' . ( isset($mapping[0]['host']) ? $mapping[0]['host'] : '' );
+ $https_url = 'https://' . ( isset($mapping[1]['host']) ? $mapping[1]['host'] : '' );
preg_match('|' . $http_url . '|', $url, $matches);
if ( sizeof($matches) > 0 ) {
$url = preg_replace('|' . $http_url . '|', $https_url, $url);
View
12 view/metabox/url_filters.php
@@ -11,7 +11,7 @@
<tr valign="top">
<td colspan="2"><h4><?php _e('Secure Filters','wordpress-https'); ?></h4></td>
</tr>
-<?php if ( sizeof($this->getSetting('secure_filter')) > 0 ) { foreach ( (array)$this->getSetting('secure_filter') as $filter ) { ?>
+<?php if ( sizeof($this->getSetting('secure_filter')) > 0 ) : foreach ( (array)$this->getSetting('secure_filter') as $filter ) : ?>
<tr valign="top" class="secure_url_filters_row">
<td>
<input type="text" name="secure_url_filters[]" value="<?php echo $filter; ?>" />
@@ -21,7 +21,7 @@
<a class="add" href="#" title="<?php _e('Add URL Filter','wordpress-https'); ?>"><?php _e('Add','wordpress-https'); ?></a>
</td>
</tr>
-<?php } } else { ?>
+<?php endforeach; else: ?>
<tr valign="top" class="secure_url_filters_row">
<td>
<input type="text" name="secure_url_filters[]" value="" />
@@ -31,14 +31,14 @@
<a class="add" href="#" title="<?php _e('Add URL Filter','wordpress-https'); ?>"><?php _e('Add','wordpress-https'); ?></a>
</td>
</tr>
-<?php } ?>
+<?php endif; ?>
</table>
<table class="form-table url_filters" id="unsecure_url_filters">
<tr valign="top">
<td colspan="2"><h4><?php _e('Unsecure Filters','wordpress-https'); ?></h4></td>
</tr>
-<?php if ( sizeof($this->getSetting('unsecure_filter')) > 0 ) { foreach ( (array)$this->getSetting('unsecure_filter') as $filter ) { ?>
+<?php if ( sizeof($this->getSetting('unsecure_filter')) > 0 ) : foreach ( (array)$this->getSetting('unsecure_filter') as $filter ) : ?>
<tr valign="top" class="unsecure_url_filters_row">
<td>
<input type="text" name="unsecure_url_filters[]" value="<?php echo $filter; ?>" />
@@ -48,7 +48,7 @@
<a class="add" href="#" title="<?php _e('Add URL Filter','wordpress-https'); ?>"><?php _e('Add','wordpress-https'); ?></a>
</td>
</tr>
-<?php } } else { ?>
+<?php endforeach; else: ?>
<tr valign="top" class="unsecure_url_filters_row">
<td>
<input type="text" name="unsecure_url_filters[]" value="" />
@@ -58,7 +58,7 @@
<a class="add" href="#" title="<?php _e('Add URL Filter','wordpress-https'); ?>"><?php _e('Add','wordpress-https'); ?></a>
</td>
</tr>
-<?php } ?>
+<?php endif; ?>
</table>
<p class="button-controls">
View
8 view/metabox/url_mapping.php
@@ -55,8 +55,8 @@
<tr valign="top" class="url_mapping_row">
<td class="scheme">
<select name="url_mapping[scheme][]">
- <option<?php echo @$mapping[0]['scheme'] == 'http' ? ' selected="selected"' : ''; ?>>http</option>
- <option<?php echo @$mapping[0]['scheme'] == 'https' ? ' selected="selected"' : ''; ?>>https</option>
+ <option<?php echo isset($mapping[0]['scheme']) && $mapping[0]['scheme'] == 'http' ? ' selected="selected"' : ''; ?>>http</option>
+ <option<?php echo isset($mapping[0]['scheme']) && $mapping[0]['scheme'] == 'https' ? ' selected="selected"' : ''; ?>>https</option>
</select>
</td>
<td class="sep">
@@ -70,8 +70,8 @@
</td>
<td class="scheme">
<select name="url_mapping[scheme][]">
- <option<?php echo @$mapping[1]['scheme'] == 'https' ? ' selected="selected"' : ''; ?>>https</option>
- <option<?php echo @$mapping[1]['scheme'] == 'http' ? ' selected="selected"' : ''; ?>>http</option>
+ <option<?php echo isset($mapping[1]['scheme']) && $mapping[1]['scheme'] == 'https' ? ' selected="selected"' : ''; ?>>https</option>
+ <option<?php echo isset($mapping[1]['scheme']) && $mapping[1]['scheme'] == 'http' ? ' selected="selected"' : ''; ?>>http</option>
</select>
</td>
<td class="sep">
Please sign in to comment.
Something went wrong with that request. Please try again.