<!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>[2327] 2013/codebykat/post-by-email/trunk/22942_updated_for_3.7.diff: updated core patch to fix merge conflicts with current trunk, remove post by email options from sanitize_option, and add _doing_it_wrong to wp-mail.php.</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 { 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">
<dt>Revision</dt> <dd><a href="http://gsoc.trac.wordpress.org/changeset/2327">2327</a></dd>
<dt>Author</dt> <dd>codebykat</dd>
<dt>Date</dt> <dd>2013-09-16 16:30:44 +0000 (Mon, 16 Sep 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>updated core patch to fix merge conflicts with current trunk, remove post by email options from sanitize_option, and add _doing_it_wrong to wp-mail.php.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#2013codebykatpostbyemailtrunk22942_updated_for_37diff">2013/codebykat/post-by-email/trunk/22942_updated_for_3.7.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="2013codebykatpostbyemailtrunk22942_updated_for_37diff"></a>
<div class="modfile"><h4>Modified: 2013/codebykat/post-by-email/trunk/22942_updated_for_3.7.diff (2326 => 2327)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/codebykat/post-by-email/trunk/22942_updated_for_3.7.diff    2013-09-16 15:12:19 UTC (rev 2326)
+++ 2013/codebykat/post-by-email/trunk/22942_updated_for_3.7.diff       2013-09-16 16:30:44 UTC (rev 2327)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> diff --git wp-admin/includes/schema.php wp-admin/includes/schema.php
</span><del>-index b200995..ec5d1ca 100644
</del><ins>+index 037210a..a5e896b 100644
</ins><span class="cx"> --- wp-admin/includes/schema.php
</span><span class="cx"> +++ wp-admin/includes/schema.php
</span><del>-@@ -369,10 +369,6 @@ function populate_options() {
</del><ins>+@@ -373,10 +373,6 @@ function populate_options() {
</ins><span class="cx">   'comments_notify' => 1,
</span><span class="cx">          'posts_per_rss' => 10,
</span><span class="cx">          'rss_use_excerpt' => 0,
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx">          'default_category' => 1,
</span><span class="cx">          'default_comment_status' => 'open',
</span><span class="cx">          'default_ping_status' => 'open',
</span><del>-@@ -476,6 +472,9 @@ function populate_options() {
</del><ins>+@@ -480,6 +476,9 @@ function populate_options() {
</ins><span class="cx">  
</span><span class="cx">          // 3.5
</span><span class="cx">          'link_manager_enabled' => 0,
</span><span class="lines">@@ -24,14 +24,14 @@
</span><span class="cx">  
</span><span class="cx">          // 3.3
</span><span class="cx"> diff --git wp-admin/includes/upgrade.php wp-admin/includes/upgrade.php
</span><del>-index 0d17d8f..63e6c1a 100644
</del><ins>+index cfbaac8..354cb6f 100644
</ins><span class="cx"> --- wp-admin/includes/upgrade.php
</span><span class="cx"> +++ wp-admin/includes/upgrade.php
</span><span class="cx"> @@ -402,10 +402,15 @@ function upgrade_all() {
</span><span class="cx">          if ( $wp_current_db_version < 22422 )
</span><span class="cx">                  upgrade_350();
</span><span class="cx">  
</span><del>-+      if ( $wp_current_db_version < 25150 )
</del><ins>++       if ( $wp_current_db_version < 25448 )
</ins><span class="cx"> +         upgrade_370();
</span><span class="cx"> +
</span><span class="cx">          maybe_disable_link_manager();
</span><span class="lines">@@ -68,12 +68,12 @@
</span><span class="cx">  /**
</span><span class="cx"> + * Disables Post by Email options if, at the time of upgrade, the settings have not been changed from original defaults.
</span><span class="cx"> + *
</span><del>-+ * @since 3.6.0
</del><ins>++ * @since 3.7.0
</ins><span class="cx"> + */
</span><span class="cx"> +function maybe_disable_post_by_email() {
</span><span class="cx"> +        global $wp_current_db_version;
</span><span class="cx"> +
</span><del>-+      if ( $wp_current_db_version >= 25134 && get_option( 'post_by_email_enabled' ) && 'mail.example.com' == get_option( 'mailserver_url' ) )
</del><ins>++       if ( $wp_current_db_version >= 25448 && get_option( 'post_by_email_enabled' ) && 'mail.example.com' == get_option( 'mailserver_url' ) )
</ins><span class="cx"> +         update_option( 'post_by_email_enabled', 0 );
</span><span class="cx"> +}
</span><span class="cx"> +
</span><span class="lines">@@ -82,13 +82,14 @@
</span><span class="cx">   *
</span><span class="cx">   * @since 2.9.0
</span><span class="cx"> diff --git wp-admin/options-writing.php wp-admin/options-writing.php
</span><del>-index 8015bae..8c0ea6d 100644
</del><ins>+index 87fbf53..4202ef6 100644
</ins><span class="cx"> --- wp-admin/options-writing.php
</span><span class="cx"> +++ wp-admin/options-writing.php
</span><del>-@@ -28,14 +28,6 @@ get_current_screen()->add_help_tab( array(
</del><ins>+@@ -28,15 +28,6 @@ get_current_screen()->add_help_tab( array(
</ins><span class="cx">   'content' => '<p>' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you&#8217;ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '</p>',
</span><span class="cx">  ) );
</span><span class="cx">  
</span><ins>+-//duplicate_hook
</ins><span class="cx"> -if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
</span><span class="cx"> -        get_current_screen()->add_help_tab( array(
</span><span class="cx"> -                'id'      => 'options-postemail',
</span><span class="lines">@@ -97,14 +98,15 @@
</span><span class="cx"> -        ) );
</span><span class="cx"> -}
</span><span class="cx"> -
</span><del>- if ( apply_filters( 'enable_update_services_configuration', true ) ) {
-       get_current_screen()->add_help_tab( array(
-               'id'      => 'options-services',
-@@ -122,34 +114,9 @@ do_settings_fields('writing', 'remote_publishing'); // A deprecated section.
-       <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
- </div>
</del><ins>+ /**
+ * Toggle site update services configuration functionality.
+ *
+@@ -132,39 +123,9 @@ do_settings_fields('writing', 'remote_publishing'); // A deprecated section.
</ins><span class="cx">  
</span><del>--<?php if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { ?>
</del><ins>+ <?php
+ //duplicate_hook
+-if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
+-?>
</ins><span class="cx"> -<h3 class="title"><?php _e('Post via e-mail') ?></h3>
</span><span class="cx"> -<p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: <kbd>%s</kbd>, <kbd>%s</kbd>, <kbd>%s</kbd>.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?></p>
</span><span class="cx"> -
</span><span class="lines">@@ -132,14 +134,18 @@
</span><span class="cx"> -<?php
</span><span class="cx"> -wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_category', 'orderby' => 'name', 'selected' => get_option('default_email_category'), 'hierarchical' => true));
</span><span class="cx"> -?>
</span><del>-+<?php if ( get_option( 'post_by_email_enabled' ) && apply_filters( 'enable_post_by_email_configuration', true ) ) { ?>
</del><ins>+-</td>
+-</tr>
+-<?php do_settings_fields('writing', 'post_via_email'); ?>
+-</table>
++if ( get_option( 'post_by_email_enabled' ) && apply_filters( 'enable_post_by_email_configuration', true ) ) { ?>
</ins><span class="cx"> +<h3 class="title"><?php _e( 'Post via e-mail' ) ?></h3>
</span><span class="cx"> +<p><?php _e( 'This functionality is no longer packaged with WordPress.  To continue using it, please install the <a href="http://wordpress.org/plugins/post-by-email">Post By Email plugin</a>.' ); ?></p>
</span><del>- </td>
- </tr>
- <?php do_settings_fields('writing', 'post_via_email'); ?>
</del><ins>+ <?php } ?>

+ <?php
</ins><span class="cx"> diff --git wp-includes/default-filters.php wp-includes/default-filters.php
</span><del>-index 7c55dfb..485faea 100644
</del><ins>+index b6c7527..f70458c 100644
</ins><span class="cx"> --- wp-includes/default-filters.php
</span><span class="cx"> +++ wp-includes/default-filters.php
</span><span class="cx"> @@ -301,4 +301,7 @@ add_filter( 'heartbeat_nopriv_received', 'wp_auth_check', 10, 2 );
</span><span class="lines">@@ -150,19 +156,59 @@
</span><span class="cx"> +add_filter( 'default_option_post_by_email_enabled', '__return_true' );
</span><span class="cx"> +
</span><span class="cx">  unset($filter, $action);
</span><ins>+diff --git wp-includes/formatting.php wp-includes/formatting.php
+index 58b4f9d..4655267 100644
+--- wp-includes/formatting.php
++++ wp-includes/formatting.php
+@@ -2819,7 +2819,6 @@ function sanitize_option($option, $value) {
+               case 'medium_size_h':
+               case 'large_size_w':
+               case 'large_size_h':
+-              case 'mailserver_port':
+               case 'comment_max_links':
+               case 'page_on_front':
+               case 'page_for_posts':
+@@ -2871,9 +2870,6 @@ function sanitize_option($option, $value) {

+               case 'date_format':
+               case 'time_format':
+-              case 'mailserver_url':
+-              case 'mailserver_login':
+-              case 'mailserver_pass':
+               case 'upload_path':
+                       $value = strip_tags( $value );
+                       $value = wp_kses_data( $value );
</ins><span class="cx"> diff --git wp-mail.php wp-mail.php
</span><del>-index 27290b1..59351c6 100644
</del><ins>+index 27290b1..4020a6a 100644
</ins><span class="cx"> --- wp-mail.php
</span><span class="cx"> +++ wp-mail.php
</span><del>-@@ -10,221 +10,5 @@
</del><ins>+@@ -1,8 +1,13 @@
+ <?php
+ /**
+- * Gets the email message from the user's mailbox to add as
+- * a WordPress post. Mailbox connection information must be
+- * configured under Settings > Writing
++ * This file is deprecated and has been replaced by the
++ * plugin Post By Email.  Instead of loading wp-mail.php to
++ * trigger the "wp-mail.php" action, you should trigger it
++ * yourself, either in a plugin/theme hook or via wp_cron.
++ *
++ * For more information:
++ * http://wordpress.org/plugins/post-by-email/
++ * http://codex.wordpress.org/Category:WP-Cron_Functions
+  *
+  * @package WordPress
+  */
+@@ -10,221 +15,7 @@
</ins><span class="cx">  /** Make sure that the WordPress bootstrap has run before continuing. */
</span><span class="cx">  require(dirname(__FILE__) . '/wp-load.php');
</span><span class="cx">  
</span><span class="cx"> -if ( ! apply_filters( 'enable_post_by_email_configuration', true ) )
</span><span class="cx"> -        wp_die( __( 'This action has been disabled by the administrator.' ) );
</span><del>--
</del><ins>++_doing_it_wrong( 'wp-mail.php', __( "This file is deprecated and should not be called directly.  Schedule the action 'wp-mail.php' instead." ), '3.7' );

</ins><span class="cx">  /** Allow a plugin to do a complete takeover of Post by Email **/
</span><del>- do_action('wp-mail.php');
</del><ins>+-do_action('wp-mail.php');
</ins><span class="cx"> -
</span><span class="cx"> -/** Get the POP3 class with which to access the mailbox. */
</span><span class="cx"> -require_once( ABSPATH . WPINC . '/class-pop3.php' );
</span><span class="lines">@@ -376,3 +422,5 @@
</span><span class="cx"> -}
</span><span class="cx"> -
</span><span class="cx"> -$pop3->quit();
</span><ins>++do_action('wp-mail.php');
+\ No newline at end of file
</ins></span></pre>
</div>
</div>

</body>
</html>