<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[49090] trunk: Privacy: Improve clarity of privacy error strings.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/49090">49090</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/49090","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-10-04 03:21:38 +0000 (Sun, 04 Oct 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Privacy: Improve clarity of privacy error strings.
Primarily this adds "user privacy" to the strings for privacy requests, so they are more easily distinguished from other system actions within logs.
Props garrett-eclipse, carike, birgire.
Fixes <a href="https://core.trac.wordpress.org/ticket/51351">#51351</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminerasepersonaldataphp">trunk/src/wp-admin/erase-personal-data.php</a></li>
<li><a href="#trunksrcwpadminincludesprivacytoolsphp">trunk/src/wp-admin/includes/privacy-tools.php</a></li>
<li><a href="#trunksrcwpadminoptionsprivacyphp">trunk/src/wp-admin/options-privacy.php</a></li>
<li><a href="#trunksrcwpadminprivacypolicyguidephp">trunk/src/wp-admin/privacy-policy-guide.php</a></li>
<li><a href="#trunksrcwpincludesuserphp">trunk/src/wp-includes/user.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacyGeneratePersonalDataExportFilephp">trunk/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacyProcessPersonalDataExportPagephp">trunk/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminerasepersonaldataphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/erase-personal-data.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/erase-personal-data.php 2020-10-03 01:20:49 UTC (rev 49089)
+++ trunk/src/wp-admin/erase-personal-data.php 2020-10-04 03:21:38 UTC (rev 49090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/admin.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_die( __( 'Sorry, you are not allowed to erase data on this site.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_die( __( 'Sorry, you are not allowed to erase personal data on this site.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle list table actions.
</span></span></pre></div>
<a id="trunksrcwpadminincludesprivacytoolsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/privacy-tools.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/privacy-tools.php 2020-10-03 01:20:49 UTC (rev 49089)
+++ trunk/src/wp-admin/includes/privacy-tools.php 2020-10-04 03:21:38 UTC (rev 49090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = get_post( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $request || 'user_request' !== $request->post_type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'privacy_request_error', __( 'Invalid user privacy request.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_send_user_request( $request_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $result ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! $result ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation request.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'privacy_request_error', __( 'Unable to initiate user privacy confirmation request.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = wp_get_user_request( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $request ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'privacy_request_error', __( 'Invalid user privacy request.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_settings_error(
</span><span class="cx" style="display: block; padding: 0 10px"> 'action_type',
</span><span class="cx" style="display: block; padding: 0 10px"> 'action_type',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Invalid action.' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ __( 'Invalid user privacy action.' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'error'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,7 +116,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_settings_error(
</span><span class="cx" style="display: block; padding: 0 10px"> 'action_type',
</span><span class="cx" style="display: block; padding: 0 10px"> 'action_type',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Invalid action.' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ __( 'Invalid user privacy action.' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'error'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -297,7 +297,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_privacy_generate_personal_data_export_file( $request_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! class_exists( 'ZipArchive' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Unable to generate export file. ZipArchive not available.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Unable to generate user privacy export file. ZipArchive not available.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the request.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,13 +304,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = wp_get_user_request( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $request || 'export_personal_data' !== $request->action_name ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Invalid request ID when generating export file.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Invalid request ID when generating user privacy export file.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $email_address = $request->email;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_email( $email_address ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Invalid email address when generating export file.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Invalid email address when generating user privacy export file.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create the exports folder if needed.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,7 +318,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $exports_url = wp_privacy_exports_url();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! wp_mkdir_p( $exports_dir ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Unable to create export folder.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Unable to create user privacy export folder.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Protect export folder from browsing.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,7 +326,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! file_exists( $index_pathname ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = fopen( $index_pathname, 'w' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Unable to protect export folder from browsing.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Unable to protect user privacy export folder from browsing.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> fwrite( $file, '<!-- Silence is golden. -->' );
</span><span class="cx" style="display: block; padding: 0 10px"> fclose( $file );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -395,7 +395,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $file = fopen( $json_report_pathname, 'w' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Unable to open export file (JSON report) for writing.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Unable to open user privacy export file (JSON report) for writing.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> fwrite( $file, '{' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -410,7 +410,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $file = fopen( $html_report_pathname, 'w' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Unable to open user privacy export file (HTML report) for writing.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> fwrite( $file, "<!DOCTYPE html>\n" );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -504,11 +504,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $zip = new ZipArchive;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $zip->addFile( $json_report_pathname, 'export.json' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $error = __( 'Unable to add data to JSON file.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error = __( 'Unable to add data to user privacy export file (JSON format).' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $zip->addFile( $html_report_pathname, 'index.html' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $error = __( 'Unable to add data to HTML file.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error = __( 'Unable to add data to user privacy export file (HTML format).' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $zip->close();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -529,7 +529,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $error = __( 'Unable to open export file (archive) for writing.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error = __( 'Unable to open user privacy export file (archive) for writing.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove the JSON file.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -758,7 +758,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = wp_get_user_request( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $request || 'export_personal_data' !== $request->action_name ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Invalid request ID when merging exporter data.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Invalid request ID when merging user privacy exporter data.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $export_data = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -909,7 +909,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = wp_get_user_request( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $request || 'remove_personal_data' !== $request->action_name ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_send_json_error( __( 'Invalid request ID when processing user privacy eraser data.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-admin/includes/ajax-actions.php */
</span></span></pre></div>
<a id="trunksrcwpadminoptionsprivacyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/options-privacy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/options-privacy.php 2020-10-03 01:20:49 UTC (rev 49089)
+++ trunk/src/wp-admin/options-privacy.php 2020-10-04 03:21:38 UTC (rev 49090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/admin.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'manage_privacy_options' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $action = isset( $_POST['action'] ) ? $_POST['action'] : '';
</span></span></pre></div>
<a id="trunksrcwpadminprivacypolicyguidephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/privacy-policy-guide.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/privacy-policy-guide.php 2020-10-03 01:20:49 UTC (rev 49089)
+++ trunk/src/wp-admin/privacy-policy-guide.php 2020-10-04 03:21:38 UTC (rev 49090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/admin.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'manage_privacy_options' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesuserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/user.php 2020-10-03 01:20:49 UTC (rev 49089)
+++ trunk/src/wp-includes/user.php 2020-10-04 03:21:38 UTC (rev 49090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3612,7 +3612,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $requests_query->found_posts ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'duplicate_request', __( 'An incomplete request for this email address already exists.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'duplicate_request', __( 'An incomplete user privacy request for this email address already exists.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request_id = wp_insert_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3680,7 +3680,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = wp_get_user_request( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $request ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'invalid_request', __( 'Invalid user request.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'invalid_request', __( 'Invalid user privacy request.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Localize message content for user; fallback to site default for visitors.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3862,19 +3862,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_validate_user_request_key( $request_id, $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_hasher;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request_id = absint( $request_id );
- $request = wp_get_user_request( $request_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request_id = absint( $request_id );
+ $request = wp_get_user_request( $request_id );
+ $saved_key = $request->confirm_key;
+ $key_request_time = $request->modified_timestamp;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $request ) {
- return new WP_Error( 'invalid_request', __( 'Invalid request.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $request || ! $saved_key || ! $key_request_time ) {
+ return new WP_Error( 'invalid_request', __( 'Invalid user privacy request.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'expired_link', __( 'This link has expired.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'expired_request', __( 'This user privacy request has expired.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $key ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'missing_key', __( 'Missing confirm key.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'missing_key', __( 'This user privacy request is missing the confirmation key.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $wp_hasher ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3882,17 +3884,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_hasher = new PasswordHash( 8, true );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $key_request_time = $request->modified_timestamp;
- $saved_key = $request->confirm_key;
-
- if ( ! $saved_key ) {
- return new WP_Error( 'invalid_key', __( 'Invalid key.' ) );
- }
-
- if ( ! $key_request_time ) {
- return new WP_Error( 'invalid_key', __( 'Invalid action.' ) );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the expiration time of confirm keys.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3904,11 +3895,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expiration_time = $key_request_time + $expiration_duration;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $wp_hasher->CheckPassword( $key, $saved_key ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'invalid_key', __( 'Invalid key.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'invalid_key', __( 'This user privacy request confirmation key is invalid.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $expiration_time || time() > $expiration_time ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return new WP_Error( 'expired_key', __( 'The confirmation email has expired.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new WP_Error( 'expired_key', __( 'This user privacy request confirmation key has expired.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacyGeneratePersonalDataExportFilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php 2020-10-03 01:20:49 UTC (rev 49089)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php 2020-10-04 03:21:38 UTC (rev 49090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,7 +164,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request_id = wp_create_user_request( 'removal-requester@example.com', 'remove_personal_data' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->expectException( 'WPDieException' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->expectOutputString( '{"success":false,"data":"Invalid request ID when generating export file."}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->expectOutputString( '{"success":false,"data":"Invalid request ID when generating user privacy export file."}' );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_privacy_generate_personal_data_export_file( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,7 +175,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_invalid_request_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->expectException( 'WPDieException' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->expectOutputString( '{"success":false,"data":"Invalid request ID when generating export file."}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->expectOutputString( '{"success":false,"data":"Invalid request ID when generating user privacy export file."}' );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_privacy_generate_personal_data_export_file( 123456789 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,7 +195,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->expectException( 'WPDieException' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->expectOutputString( '{"success":false,"data":"Invalid email address when generating export file."}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->expectOutputString( '{"success":false,"data":"Invalid email address when generating user privacy export file."}' );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_privacy_generate_personal_data_export_file( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -209,7 +209,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> touch( untrailingslashit( self::$exports_dir ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->expectException( 'WPDieException' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->expectOutputString( '{"success":false,"data":"Unable to create export folder."}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->expectOutputString( '{"success":false,"data":"Unable to create user privacy export folder."}' );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_privacy_generate_personal_data_export_file( self::$export_request_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacyProcessPersonalDataExportPagephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php 2020-10-03 01:20:49 UTC (rev 49089)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php 2020-10-04 03:21:38 UTC (rev 49090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,7 +367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $invalid_request_id = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Process data, given the last exporter, on the last page and send as email.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->_setup_expected_failure( '{"success":false,"data":"Invalid request ID when merging exporter data."}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->_setup_expected_failure( '{"success":false,"data":"Invalid request ID when merging user privacy exporter data."}' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_privacy_process_personal_data_export_page(
</span><span class="cx" style="display: block; padding: 0 10px"> $response,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -399,7 +399,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request_id = wp_create_user_request( self::$requester_email, 'remove_personal_data' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Process data, given the last exporter, on the last page and send as email.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->_setup_expected_failure( '{"success":false,"data":"Invalid request ID when merging exporter data."}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->_setup_expected_failure( '{"success":false,"data":"Invalid request ID when merging user privacy exporter data."}' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_privacy_process_personal_data_export_page(
</span><span class="cx" style="display: block; padding: 0 10px"> $response,
</span></span></pre>
</div>
</div>
</body>
</html>