Changeset 13443 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
- Timestamp:
- 04/03/2024 07:01:21 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r13365 r13443 106 106 // If the readme generated any warnings, raise it to self::$import_warnings; 107 107 if ( $readme->warnings ) { 108 // Convert the warnings to a human readable format. 109 $readme_warnings = Readme_Validator::instance()->validate_content( $readme->raw_contents ); 110 111 foreach ( [ 'errors', 'warnings' ] as $field ) { 112 foreach ( $readme_warnings[ $field ] ?? [] as $warning ) { 113 $this->warnings[] = "Readme: {$warning}"; 114 } 115 } 108 $this->warnings = array_merge( $this->warnings, $readme->warnings ); 116 109 } 117 110 … … 128 121 $update_uri_valid = preg_match( '!^(https?://)?(wordpress.org|w.org)/plugins?/(?P<slug>[^/]+)/?$!i', $headers->UpdateURI, $update_uri_matches ); 129 122 if ( ! $update_uri_valid || $update_uri_matches['slug'] !== $plugin_slug ) { 130 $this->warnings['invalid_update_uri'] = 'Invalid Update URI header detected: ' .$headers->UpdateURI;131 132 throw new Exception( $this->warnings['invalid_update_uri']);123 $this->warnings['invalid_update_uri'] = $headers->UpdateURI; 124 125 throw new Exception( Readme_Validator::instance()->translate_code_to_message( 'invalid_update_uri' ) ); 133 126 } 134 127 } … … 153 146 154 147 if ( $unmet_dependencies ) { 155 $this->warnings['unmet_dependencies'] = 'Invalid plugin dependencies specified. The following dependencies could not be resolved: ' . implode( ', ', $requires_plugins_unmet );156 157 throw new Exception( $this->warnings['unmet_dependencies']);148 $this->warnings['unmet_dependencies'] = $requires_plugins_unmet; 149 150 throw new Exception( Readme_Validator::instance()->translate_code_to_message( 'unmet_dependencies', $requires_plugins_unmet ) ); 158 151 } 159 152 unset( $_requires_plugins, $unmet_dependencies ); … … 1169 1162 } 1170 1163 1171 // Normali se a "install theme from url" to a install-by-slug.1164 // Normalize a "install theme from url" to a install-by-slug. 1172 1165 if ( 1173 1166 'installTheme' === $step['step'] && … … 1210 1203 } 1211 1204 1212 1213 1205 $contents = json_encode( $decoded_file ); // Re-encode to minimize whitespace 1214 1206 }
Note: See TracChangeset
for help on using the changeset viewer.