@@ -119,8 +119,11 @@ |
||
| 119 | 119 | } |
| 120 | 120 | ?> |
| 121 | 121 | </label> |
| 122 | - <?php else : ?> |
|
| 123 | - <label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); ?></label> |
|
| 122 | + <?php else { |
|
| 123 | + : ?> |
|
| 124 | + <label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); |
|
| 125 | +} |
|
| 126 | +?></label> |
|
| 124 | 127 | <?php endif; ?> |
| 125 | 128 | <input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term ); ?>" autofocus="autofocus" /> |
| 126 | 129 | <?php submit_button( __( 'Search' ), '', 'search', false ); ?> |
@@ -71,10 +71,14 @@ discard block |
||
| 71 | 71 | $this->PushError($fnction,'Read failed'); |
| 72 | 72 | } else { |
| 73 | 73 | $this->_message.=$tmp; |
| 74 | - if(preg_match("/^([0-9]{3})(-(.*[".CRLF."]{1,2})+\\1)? [^".CRLF."]+[".CRLF."]{1,2}$/", $this->_message, $regs)) $go=false; |
|
| 74 | + if(preg_match("/^([0-9]{3})(-(.*[".CRLF."]{1,2})+\\1)? [^".CRLF."]+[".CRLF."]{1,2}$/", $this->_message, $regs)) { |
|
| 75 | + $go=false; |
|
| 76 | + } |
|
| 75 | 77 | } |
| 76 | 78 | } while($go); |
| 77 | - if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; |
|
| 79 | + if($this->LocalEcho) { |
|
| 80 | + echo "GET < ".rtrim($this->_message, CRLF).CRLF; |
|
| 81 | + } |
|
| 78 | 82 | $this->_code=(int)$regs[1]; |
| 79 | 83 | return $result; |
| 80 | 84 | } |
@@ -84,19 +88,25 @@ discard block |
||
| 84 | 88 | $this->PushError($fnction,'Connect first'); |
| 85 | 89 | return FALSE; |
| 86 | 90 | } |
| 87 | - if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; |
|
| 91 | + if($this->LocalEcho) { |
|
| 92 | + echo "PUT > ",$cmd,CRLF; |
|
| 93 | + } |
|
| 88 | 94 | $status=@fputs($this->_ftp_control_sock, $cmd.CRLF); |
| 89 | 95 | if($status===false) { |
| 90 | 96 | $this->PushError($fnction,'socket write failed'); |
| 91 | 97 | return FALSE; |
| 92 | 98 | } |
| 93 | 99 | $this->_lastaction=time(); |
| 94 | - if(!$this->_readmsg($fnction)) return FALSE; |
|
| 100 | + if(!$this->_readmsg($fnction)) { |
|
| 101 | + return FALSE; |
|
| 102 | + } |
|
| 95 | 103 | return TRUE; |
| 96 | 104 | } |
| 97 | 105 | |
| 98 | 106 | function _data_prepare($mode=FTP_ASCII) { |
| 99 | - if(!$this->_settype($mode)) return FALSE; |
|
| 107 | + if(!$this->_settype($mode)) { |
|
| 108 | + return FALSE; |
|
| 109 | + } |
|
| 100 | 110 | if($this->_passive) { |
| 101 | 111 | if(!$this->_exec("PASV", "pasv")) { |
| 102 | 112 | $this->_data_close(); |
@@ -115,8 +125,9 @@ discard block |
||
| 115 | 125 | $this->PushError("_data_prepare","fsockopen fails", $errstr." (".$errno.")"); |
| 116 | 126 | $this->_data_close(); |
| 117 | 127 | return FALSE; |
| 128 | + } else { |
|
| 129 | + $this->_ftp_data_sock; |
|
| 118 | 130 | } |
| 119 | - else $this->_ftp_data_sock; |
|
| 120 | 131 | } else { |
| 121 | 132 | $this->SendMSG("Only passive connections available!"); |
| 122 | 133 | return FALSE; |
@@ -125,24 +136,35 @@ discard block |
||
| 125 | 136 | } |
| 126 | 137 | |
| 127 | 138 | function _data_read($mode=FTP_ASCII, $fp=NULL) { |
| 128 | - if(is_resource($fp)) $out=0; |
|
| 129 | - else $out=""; |
|
| 139 | + if(is_resource($fp)) { |
|
| 140 | + $out=0; |
|
| 141 | + } else { |
|
| 142 | + $out=""; |
|
| 143 | + } |
|
| 130 | 144 | if(!$this->_passive) { |
| 131 | 145 | $this->SendMSG("Only passive connections available!"); |
| 132 | 146 | return FALSE; |
| 133 | 147 | } |
| 134 | 148 | while (!feof($this->_ftp_data_sock)) { |
| 135 | 149 | $block=fread($this->_ftp_data_sock, $this->_ftp_buff_size); |
| 136 | - if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block); |
|
| 137 | - if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); |
|
| 138 | - else $out.=$block; |
|
| 150 | + if($mode!=FTP_BINARY) { |
|
| 151 | + $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block); |
|
| 152 | + } |
|
| 153 | + if(is_resource($fp)) { |
|
| 154 | + $out+=fwrite($fp, $block, strlen($block)); |
|
| 155 | + } else { |
|
| 156 | + $out.=$block; |
|
| 157 | + } |
|
| 139 | 158 | } |
| 140 | 159 | return $out; |
| 141 | 160 | } |
| 142 | 161 | |
| 143 | 162 | function _data_write($mode=FTP_ASCII, $fp=NULL) { |
| 144 | - if(is_resource($fp)) $out=0; |
|
| 145 | - else $out=""; |
|
| 163 | + if(is_resource($fp)) { |
|
| 164 | + $out=0; |
|
| 165 | + } else { |
|
| 166 | + $out=""; |
|
| 167 | + } |
|
| 146 | 168 | if(!$this->_passive) { |
| 147 | 169 | $this->SendMSG("Only passive connections available!"); |
| 148 | 170 | return FALSE; |
@@ -150,14 +172,20 @@ discard block |
||
| 150 | 172 | if(is_resource($fp)) { |
| 151 | 173 | while(!feof($fp)) { |
| 152 | 174 | $block=fread($fp, $this->_ftp_buff_size); |
| 153 | - if(!$this->_data_write_block($mode, $block)) return false; |
|
| 175 | + if(!$this->_data_write_block($mode, $block)) { |
|
| 176 | + return false; |
|
| 177 | + } |
|
| 154 | 178 | } |
| 155 | - } elseif(!$this->_data_write_block($mode, $fp)) return false; |
|
| 179 | + } elseif(!$this->_data_write_block($mode, $fp)) { |
|
| 180 | + return false; |
|
| 181 | + } |
|
| 156 | 182 | return TRUE; |
| 157 | 183 | } |
| 158 | 184 | |
| 159 | 185 | function _data_write_block($mode, $block) { |
| 160 | - if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); |
|
| 186 | + if($mode!=FTP_BINARY) { |
|
| 187 | + $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); |
|
| 188 | + } |
|
| 161 | 189 | do { |
| 162 | 190 | if(($t=@fwrite($this->_ftp_data_sock, $block))===FALSE) { |
| 163 | 191 | $this->PushError("_data_write","Can't write to socket"); |
@@ -855,10 +855,12 @@ discard block |
||
| 855 | 855 | </p> |
| 856 | 856 | |
| 857 | 857 | <?php |
| 858 | - else : |
|
| 858 | + else { |
|
| 859 | + : |
|
| 859 | 860 | switch ( $comment->comment_type ) { |
| 860 | 861 | case 'pingback': |
| 861 | 862 | $type = __( 'Pingback' ); |
| 863 | + } |
|
| 862 | 864 | break; |
| 863 | 865 | case 'trackback': |
| 864 | 866 | $type = __( 'Trackback' ); |
@@ -1921,8 +1923,11 @@ discard block |
||
| 1921 | 1923 | <div class="site-health-progress-label"> |
| 1922 | 1924 | <?php if ( false === $get_issues ) : ?> |
| 1923 | 1925 | <?php _e( 'No information yet…' ); ?> |
| 1924 | - <?php else : ?> |
|
| 1925 | - <?php _e( 'Results are still loading…' ); ?> |
|
| 1926 | + <?php else { |
|
| 1927 | + : ?> |
|
| 1928 | + <?php _e( 'Results are still loading…' ); |
|
| 1929 | +} |
|
| 1930 | +?> |
|
| 1926 | 1931 | <?php endif; ?> |
| 1927 | 1932 | </div> |
| 1928 | 1933 | </div> |
@@ -1938,18 +1943,24 @@ discard block |
||
| 1938 | 1943 | ); |
| 1939 | 1944 | ?> |
| 1940 | 1945 | </p> |
| 1941 | - <?php else : ?> |
|
| 1946 | + <?php else { |
|
| 1947 | + : ?> |
|
| 1942 | 1948 | <p> |
| 1943 | 1949 | <?php if ( $issues_total <= 0 ) : ?> |
| 1944 | - <?php _e( 'Great job! Your site currently passes all site health checks.' ); ?> |
|
| 1950 | + <?php _e( 'Great job! Your site currently passes all site health checks.' ); |
|
| 1951 | +} |
|
| 1952 | +?> |
|
| 1945 | 1953 | <?php elseif ( 1 === (int) $issue_counts['critical'] ) : ?> |
| 1946 | 1954 | <?php _e( 'Your site has a critical issue that should be addressed as soon as possible to improve its performance and security.' ); ?> |
| 1947 | 1955 | <?php elseif ( $issue_counts['critical'] > 1 ) : ?> |
| 1948 | 1956 | <?php _e( 'Your site has critical issues that should be addressed as soon as possible to improve its performance and security.' ); ?> |
| 1949 | 1957 | <?php elseif ( 1 === (int) $issue_counts['recommended'] ) : ?> |
| 1950 | 1958 | <?php _e( 'Your site’s health is looking good, but there is still one thing you can do to improve its performance and security.' ); ?> |
| 1951 | - <?php else : ?> |
|
| 1952 | - <?php _e( 'Your site’s health is looking good, but there are still some things you can do to improve its performance and security.' ); ?> |
|
| 1959 | + <?php else { |
|
| 1960 | + : ?> |
|
| 1961 | + <?php _e( 'Your site’s health is looking good, but there are still some things you can do to improve its performance and security.' ); |
|
| 1962 | +} |
|
| 1963 | +?> |
|
| 1953 | 1964 | <?php endif; ?> |
| 1954 | 1965 | </p> |
| 1955 | 1966 | <?php endif; ?> |
@@ -2025,8 +2036,11 @@ discard block |
||
| 2025 | 2036 | <h3><?php _e( 'Customize your entire site with block themes' ); ?></h3> |
| 2026 | 2037 | <p><?php _e( 'Design everything on your site — from the header down to the footer, all using blocks and patterns.' ); ?></p> |
| 2027 | 2038 | <a href="<?php echo esc_url( admin_url( 'site-editor.php' ) ); ?>"><?php _e( 'Open site editor' ); ?></a> |
| 2028 | - <?php else : ?> |
|
| 2029 | - <h3><?php _e( 'Start Customizing' ); ?></h3> |
|
| 2039 | + <?php else { |
|
| 2040 | + : ?> |
|
| 2041 | + <h3><?php _e( 'Start Customizing' ); |
|
| 2042 | +} |
|
| 2043 | +?></h3> |
|
| 2030 | 2044 | <p><?php _e( 'Configure your site’s logo, header, menus, and more in the Customizer.' ); ?></p> |
| 2031 | 2045 | <?php if ( $can_customize ) : ?> |
| 2032 | 2046 | <a class="load-customize hide-if-no-customize" href="<?php echo wp_customize_url(); ?>"><?php _e( 'Open the Customizer' ); ?></a> |
@@ -2041,8 +2055,11 @@ discard block |
||
| 2041 | 2055 | <h3><?php _e( 'Switch up your site’s look & feel with Styles' ); ?></h3> |
| 2042 | 2056 | <p><?php _e( 'Tweak your site, or give it a whole new look! Get creative — how about a new color palette or font?' ); ?></p> |
| 2043 | 2057 | <a href="<?php echo esc_url( admin_url( 'site-editor.php?styles=open' ) ); ?>"><?php _e( 'Edit styles' ); ?></a> |
| 2044 | - <?php else : ?> |
|
| 2045 | - <h3><?php _e( 'Discover a new way to build your site.' ); ?></h3> |
|
| 2058 | + <?php else { |
|
| 2059 | + : ?> |
|
| 2060 | + <h3><?php _e( 'Discover a new way to build your site.' ); |
|
| 2061 | +} |
|
| 2062 | +?></h3> |
|
| 2046 | 2063 | <p><?php _e( 'There is a new kind of WordPress theme, called a block theme, that lets you build the site you’ve always wanted — with blocks and styles.' ); ?></p> |
| 2047 | 2064 | <a href="<?php echo esc_url( __( 'https://wordpress.org/support/article/block-themes/' ) ); ?>"><?php _e( 'Learn about block themes' ); ?></a> |
| 2048 | 2065 | <?php endif; ?> |
@@ -148,8 +148,11 @@ discard block |
||
| 148 | 148 | <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option> |
| 149 | 149 | <?php if ( 'auto-draft' === $post->post_status ) : ?> |
| 150 | 150 | <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> |
| 151 | - <?php else : ?> |
|
| 152 | - <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> |
|
| 151 | + <?php else { |
|
| 152 | + : ?> |
|
| 153 | + <option<?php selected( $post->post_status, 'draft' ); |
|
| 154 | +} |
|
| 155 | +?> value='draft'><?php _e( 'Draft' ); ?></option> |
|
| 153 | 156 | <?php endif; ?> |
| 154 | 157 | </select> |
| 155 | 158 | <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e( 'OK' ); ?></a> |
@@ -354,15 +357,21 @@ discard block |
||
| 354 | 357 | <input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" /> |
| 355 | 358 | <?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?> |
| 356 | 359 | <?php |
| 357 | - else : |
|
| 360 | + else { |
|
| 361 | + : |
|
| 358 | 362 | ?> |
| 359 | - <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" /> |
|
| 363 | + <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); |
|
| 364 | + } |
|
| 365 | + ?>" /> |
|
| 360 | 366 | <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?> |
| 361 | 367 | <?php |
| 362 | 368 | endif; |
| 363 | - else : |
|
| 369 | + else { |
|
| 370 | + : |
|
| 364 | 371 | ?> |
| 365 | - <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" /> |
|
| 372 | + <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); |
|
| 373 | + } |
|
| 374 | + ?>" /> |
|
| 366 | 375 | <?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?> |
| 367 | 376 | <?php |
| 368 | 377 | endif; |
@@ -630,9 +630,11 @@ |
||
| 630 | 630 | ); |
| 631 | 631 | echo '</p></li>'; |
| 632 | 632 | |
| 633 | - else : // End $is_nginx. Construct an .htaccess file instead: |
|
| 633 | + else { |
|
| 634 | + : // End $is_nginx. Construct an .htaccess file instead: |
|
| 634 | 635 | |
| 635 | 636 | $ms_files_rewriting = ''; |
| 637 | + } |
|
| 636 | 638 | if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { |
| 637 | 639 | $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^"; |
| 638 | 640 | $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n"; |
@@ -3186,7 +3186,8 @@ discard block |
||
| 3186 | 3186 | </div> |
| 3187 | 3187 | <?php |
| 3188 | 3188 | |
| 3189 | - else : |
|
| 3189 | + else { |
|
| 3190 | + : |
|
| 3190 | 3191 | |
| 3191 | 3192 | /** |
| 3192 | 3193 | * Fires when an attachment type can't be rendered in the edit form. |
@@ -3196,6 +3197,7 @@ discard block |
||
| 3196 | 3197 | * @param WP_Post $post A post object. |
| 3197 | 3198 | */ |
| 3198 | 3199 | do_action( 'wp_edit_form_attachment_display', $post ); |
| 3200 | + } |
|
| 3199 | 3201 | |
| 3200 | 3202 | endif; |
| 3201 | 3203 | |
@@ -451,9 +451,12 @@ discard block |
||
| 451 | 451 | <form method="get"> |
| 452 | 452 | <?php if ( $table_row ) : ?> |
| 453 | 453 | <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange"> |
| 454 | -<?php else : ?> |
|
| 454 | +<?php else { |
|
| 455 | + : ?> |
|
| 455 | 456 | <div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;"> |
| 456 | -<?php endif; ?> |
|
| 457 | +<?php endif; |
|
| 458 | +} |
|
| 459 | +?> |
|
| 457 | 460 | <fieldset class="comment-reply"> |
| 458 | 461 | <legend> |
| 459 | 462 | <span class="hidden" id="editlegend"><?php _e( 'Edit Comment' ); ?></span> |
@@ -525,9 +528,12 @@ discard block |
||
| 525 | 528 | </fieldset> |
| 526 | 529 | <?php if ( $table_row ) : ?> |
| 527 | 530 | </td></tr></tbody></table> |
| 528 | - <?php else : ?> |
|
| 531 | + <?php else { |
|
| 532 | + : ?> |
|
| 529 | 533 | </div></div> |
| 530 | - <?php endif; ?> |
|
| 534 | + <?php endif; |
|
| 535 | +} |
|
| 536 | +?> |
|
| 531 | 537 | </form> |
| 532 | 538 | <?php |
| 533 | 539 | } |
@@ -979,9 +985,12 @@ discard block |
||
| 979 | 985 | <div class="error"><p><?php _e( 'Before you can upload your import file, you will need to fix the following error:' ); ?></p> |
| 980 | 986 | <p><strong><?php echo $upload_dir['error']; ?></strong></p></div> |
| 981 | 987 | <?php |
| 982 | - else : |
|
| 988 | + else { |
|
| 989 | + : |
|
| 983 | 990 | ?> |
| 984 | -<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>"> |
|
| 991 | +<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); |
|
| 992 | + } |
|
| 993 | + ?>"> |
|
| 985 | 994 | <p> |
| 986 | 995 | <?php |
| 987 | 996 | printf( |
@@ -336,8 +336,11 @@ |
||
| 336 | 336 | <span class="widget-control-close-wrapper"> |
| 337 | 337 | | <a href="widgets.php" class="button-link widget-control-close"><?php _e( 'Cancel' ); ?></a> |
| 338 | 338 | </span> |
| 339 | - <?php else : ?> |
|
| 340 | - <a href="widgets.php" class="button-link widget-control-close"><?php _e( 'Cancel' ); ?></a> |
|
| 339 | + <?php else { |
|
| 340 | + : ?> |
|
| 341 | + <a href="widgets.php" class="button-link widget-control-close"><?php _e( 'Cancel' ); |
|
| 342 | +} |
|
| 343 | +?></a> |
|
| 341 | 344 | <?php endif; ?> |
| 342 | 345 | </div> |
| 343 | 346 | <div class="alignright"> |
@@ -51,15 +51,17 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
| 53 | 53 | |
| 54 | - if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) |
|
| 55 | - $iteration_count_log2 = 8; |
|
| 54 | + if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) { |
|
| 55 | + $iteration_count_log2 = 8; |
|
| 56 | + } |
|
| 56 | 57 | $this->iteration_count_log2 = $iteration_count_log2; |
| 57 | 58 | |
| 58 | 59 | $this->portable_hashes = $portable_hashes; |
| 59 | 60 | |
| 60 | 61 | $this->random_state = microtime(); |
| 61 | - if (function_exists('getmypid')) |
|
| 62 | - $this->random_state .= getmypid(); |
|
| 62 | + if (function_exists('getmypid')) { |
|
| 63 | + $this->random_state .= getmypid(); |
|
| 64 | + } |
|
| 63 | 65 | } |
| 64 | 66 | |
| 65 | 67 | function PasswordHash($iteration_count_log2, $portable_hashes) |
@@ -96,16 +98,20 @@ discard block |
||
| 96 | 98 | do { |
| 97 | 99 | $value = ord($input[$i++]); |
| 98 | 100 | $output .= $this->itoa64[$value & 0x3f]; |
| 99 | - if ($i < $count) |
|
| 100 | - $value |= ord($input[$i]) << 8; |
|
| 101 | + if ($i < $count) { |
|
| 102 | + $value |= ord($input[$i]) << 8; |
|
| 103 | + } |
|
| 101 | 104 | $output .= $this->itoa64[($value >> 6) & 0x3f]; |
| 102 | - if ($i++ >= $count) |
|
| 103 | - break; |
|
| 104 | - if ($i < $count) |
|
| 105 | - $value |= ord($input[$i]) << 16; |
|
| 105 | + if ($i++ >= $count) { |
|
| 106 | + break; |
|
| 107 | + } |
|
| 108 | + if ($i < $count) { |
|
| 109 | + $value |= ord($input[$i]) << 16; |
|
| 110 | + } |
|
| 106 | 111 | $output .= $this->itoa64[($value >> 12) & 0x3f]; |
| 107 | - if ($i++ >= $count) |
|
| 108 | - break; |
|
| 112 | + if ($i++ >= $count) { |
|
| 113 | + break; |
|
| 114 | + } |
|
| 109 | 115 | $output .= $this->itoa64[($value >> 18) & 0x3f]; |
| 110 | 116 | } while ($i < $count); |
| 111 | 117 | |
@@ -125,23 +131,27 @@ discard block |
||
| 125 | 131 | function crypt_private($password, $setting) |
| 126 | 132 | { |
| 127 | 133 | $output = '*0'; |
| 128 | - if (substr($setting, 0, 2) === $output) |
|
| 129 | - $output = '*1'; |
|
| 134 | + if (substr($setting, 0, 2) === $output) { |
|
| 135 | + $output = '*1'; |
|
| 136 | + } |
|
| 130 | 137 | |
| 131 | 138 | $id = substr($setting, 0, 3); |
| 132 | 139 | # We use "$P$", phpBB3 uses "$H$" for the same thing |
| 133 | - if ($id !== '$P$' && $id !== '$H$') |
|
| 134 | - return $output; |
|
| 140 | + if ($id !== '$P$' && $id !== '$H$') { |
|
| 141 | + return $output; |
|
| 142 | + } |
|
| 135 | 143 | |
| 136 | 144 | $count_log2 = strpos($this->itoa64, $setting[3]); |
| 137 | - if ($count_log2 < 7 || $count_log2 > 30) |
|
| 138 | - return $output; |
|
| 145 | + if ($count_log2 < 7 || $count_log2 > 30) { |
|
| 146 | + return $output; |
|
| 147 | + } |
|
| 139 | 148 | |
| 140 | 149 | $count = 1 << $count_log2; |
| 141 | 150 | |
| 142 | 151 | $salt = substr($setting, 4, 8); |
| 143 | - if (strlen($salt) !== 8) |
|
| 144 | - return $output; |
|
| 152 | + if (strlen($salt) !== 8) { |
|
| 153 | + return $output; |
|
| 154 | + } |
|
| 145 | 155 | |
| 146 | 156 | # We were kind of forced to use MD5 here since it's the only |
| 147 | 157 | # cryptographic primitive that was available in all versions |
@@ -213,17 +223,20 @@ discard block |
||
| 213 | 223 | $random = $this->get_random_bytes(16); |
| 214 | 224 | $hash = |
| 215 | 225 | crypt($password, $this->gensalt_blowfish($random)); |
| 216 | - if (strlen($hash) === 60) |
|
| 217 | - return $hash; |
|
| 226 | + if (strlen($hash) === 60) { |
|
| 227 | + return $hash; |
|
| 228 | + } |
|
| 218 | 229 | } |
| 219 | 230 | |
| 220 | - if (strlen($random) < 6) |
|
| 221 | - $random = $this->get_random_bytes(6); |
|
| 231 | + if (strlen($random) < 6) { |
|
| 232 | + $random = $this->get_random_bytes(6); |
|
| 233 | + } |
|
| 222 | 234 | $hash = |
| 223 | 235 | $this->crypt_private($password, |
| 224 | 236 | $this->gensalt_private($random)); |
| 225 | - if (strlen($hash) === 34) |
|
| 226 | - return $hash; |
|
| 237 | + if (strlen($hash) === 34) { |
|
| 238 | + return $hash; |
|
| 239 | + } |
|
| 227 | 240 | |
| 228 | 241 | # Returning '*' on error is safe here, but would _not_ be safe |
| 229 | 242 | # in a crypt(3)-like function used _both_ for generating new |
@@ -238,8 +251,9 @@ discard block |
||
| 238 | 251 | } |
| 239 | 252 | |
| 240 | 253 | $hash = $this->crypt_private($password, $stored_hash); |
| 241 | - if ($hash[0] === '*') |
|
| 242 | - $hash = crypt($password, $stored_hash); |
|
| 254 | + if ($hash[0] === '*') { |
|
| 255 | + $hash = crypt($password, $stored_hash); |
|
| 256 | + } |
|
| 243 | 257 | |
| 244 | 258 | # This is not constant-time. In order to keep the code simple, |
| 245 | 259 | # for timing safety we currently rely on the salts being |