This commit is contained in:
Yurii Nalivaiko
2018-11-22 14:04:18 +02:00
55 changed files with 576 additions and 658 deletions
+14 -17
View File
@@ -585,27 +585,25 @@ function um_redirect_home() {
* @param $url
*/
function um_js_redirect( $url ) {
if (headers_sent() || empty( $url )) {
if ( headers_sent() || empty( $url ) ) {
//for blank redirects
if ('' == $url) {
if ( '' == $url ) {
$url = set_url_scheme( '//' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] );
}
$funtext = "echo \"<script data-cfasync='false' type='text/javascript'>window.location = '" . $url . "'</script>\";";
register_shutdown_function( create_function( '', $funtext ) );
register_shutdown_function( function( $url ) {
echo '<script data-cfasync="false" type="text/javascript">window.location = "' . $url . '"</script>';
}, $url );
if (1 < ob_get_level()) {
while (ob_get_level() > 1) {
if ( 1 < ob_get_level() ) {
while ( ob_get_level() > 1 ) {
ob_end_clean();
}
}
?>
<script data-cfasync='false' type="text/javascript">
window.location = '<?php echo $url; ?>';
</script>
<?php
exit;
} ?>
<script data-cfasync='false' type="text/javascript">
window.location = '<?php echo $url; ?>';
</script>
<?php exit;
} else {
wp_redirect( $url );
}
@@ -1603,6 +1601,7 @@ function um_multi_admin_email() {
$emails_array = array_map( 'trim', $emails_array );
}
$emails_array = array_unique( $emails_array );
return $emails_array;
}
@@ -2655,7 +2654,5 @@ function is_ultimatemember() {
* Maybe set empty time limit
*/
function um_maybe_unset_time_limit() {
if ( ! ini_get( 'safe_mode' ) ) {
@set_time_limit(0);
}
@set_time_limit( 0 );
}