Making WordPress.org

Changeset 10787


Ignore:
Timestamp:
03/05/2021 04:18:19 AM (6 years ago)
Author:
dd32
Message:

Theme Directory: reformat the layout of the failed command errors, for better handling in the error logging.

Follow up to [10786].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

    r10786 r10787  
    12811281                }
    12821282
     1283                // Redact any passwords that might be in a command and included in logged errors.
     1284                $command = str_replace( [ THEME_TRACBOT_PASSWORD, THEME_DROPBOX_PASSWORD ], '[redacted]', $command );
     1285
    12831286                if ( $return_var > 0 ) {
    1284                         trigger_error( "Command failed, `{$command}` return value: {$return_var} STDOUT: ```{$stdout}``` STDERR: ```{$stderr}```", E_USER_WARNING );
     1287                        trigger_error(
     1288                                "Command failed, `{$command}`\n" .
     1289                                        "Return Value: {$return_var}\n" .
     1290                                        "STDOUT: ```{$stdout}```\n" .
     1291                                        "STDERR: ```{$stderr}```",
     1292                                E_USER_WARNING
     1293                        );
    12851294                } elseif ( $stderr ) {
    1286                         trigger_error( "Command produced errors, `{$command}` return value: {$return_var} STDOUT: ```{$stdout}``` STDERR: ```{$stderr}```", E_USER_NOTICE );
     1295                        trigger_error(
     1296                                "Command produced errors, `{$command}`\n" .
     1297                                        "Return Value: {$return_var}\n" .
     1298                                        "STDOUT: ```{$stdout}```\n" .
     1299                                        "STDERR: ```{$stderr}```",
     1300                                E_USER_NOTICE
     1301                        );
    12871302                }
    12881303
Note: See TracChangeset for help on using the changeset viewer.