Permalink
Browse files

Remove unnecessary ajax boolean.

  • Loading branch information...
mvied committed Dec 30, 2012
1 parent a2de622 commit e5de7f8d908b702471f2a62e4a349fa51bf925d8
@@ -1,6 +1,6 @@
<?php
-if ( array_key_exists('ajax', $_POST) ) {
+if ( isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest' ) {
error_reporting(0);
while(@ob_end_clean());
if ( sizeof( $errors ) > 0 ) {
@@ -24,7 +24,6 @@
$('#<?php echo $this->getPlugin()->getSlug(); ?>_filters_form').submit(function() {
$('#<?php echo $this->getPlugin()->getSlug(); ?>_filters_form .submit-waiting').show();
}).ajaxForm({
- data: { ajax: '1'},
success: function(responseText, textStatus, XMLHttpRequest) {
$('#<?php echo $this->getPlugin()->getSlug(); ?>_filters_form .submit-waiting').hide();
$('#message-body').html(responseText).fadeOut(0).fadeIn().delay(5000).fadeOut();
@@ -92,7 +92,6 @@
$('#<?php echo $this->getPlugin()->getSlug(); ?>_settings_form').submit(function() {
$('#<?php echo $this->getPlugin()->getSlug(); ?>_settings_form .submit-waiting').show();
}).ajaxForm({
- data: { ajax: '1'},
success: function(responseText, textStatus, XMLHttpRequest) {
$('#<?php echo $this->getPlugin()->getSlug(); ?>_settings_form .submit-waiting').hide();
$('#message-body').html(responseText).fadeOut(0).fadeIn().delay(5000).fadeOut();
@@ -43,7 +43,7 @@
<label for="exclusive_https">
<input type="hidden" name="exclusive_https" value="0" />
<input name="exclusive_https" type="checkbox" id="exclusive_https" value="1"<?php echo (($this->getPlugin()->getSetting('exclusive_https')) ? ' checked="checked"' : ''); ?> />
- <p class="description"><?php printf( __('Any page that is not secured via %s Force SSL %s or URL Filters will be redirected to HTTP.','wordpress-https'),'<a href="' . parse_url($this->getPlugin()->getPluginUrl(), PHP_URL_PATH) . '/screenshot-2.png" class="thickbox">', '</a> '); ?></a>.</p>
+ <p class="description"><?php printf( __('Any page that is not secured via %s Force SSL %s or URL Filters will be redirected to HTTP.','wordpress-https'),'<a href="' . parse_url($this->getPlugin()->getPluginUrl(), PHP_URL_PATH) . '/screenshot-2.png" class="thickbox">', '</a> '); ?></a></p>
</label>
</fieldset>
</td>
@@ -115,7 +115,6 @@
$('#<?php echo $this->getPlugin()->getSlug(); ?>_settings_form').submit(function() {
$('#<?php echo $this->getPlugin()->getSlug(); ?>_settings_form .submit-waiting').show();
}).ajaxForm({
- data: { ajax: '1'},
success: function(responseText, textStatus, XMLHttpRequest) {
$('#<?php echo $this->getPlugin()->getSlug(); ?>_settings_form .submit-waiting').hide();
$('#message-body').html(responseText).fadeOut(0).fadeIn().delay(5000).fadeOut();
@@ -165,23 +165,7 @@ public function save() {
wp_logout();
}
- if ( array_key_exists('ajax', $_POST) ) {
- error_reporting(0);
- while(@ob_end_clean());
- if ( sizeof( $errors ) > 0 ) {
- echo "<div class=\"error below-h2 fade wphttps-message\" id=\"message\">\n\t<ul>\n";
- foreach ( $errors as $error ) {
- echo "\t\t<li><p>".$error."</p></li>\n";
- }
- echo "\t</ul>\n</div>\n";
- } else {
- echo "<div class=\"updated below-h2 fade wphttps-message\" id=\"message\"><p>" . $message . "</p></div>\n";
- if ( $logout || $reload ) {
- echo "<script type=\"text/javascript\">window.location.reload();</script>";
- }
- }
- exit();
- }
+ require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
}
}

0 comments on commit e5de7f8

Please sign in to comment.