Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/custom-post-type-ui/build/cptui.asset.php
+++ b/custom-post-type-ui/build/cptui.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array(), 'version' => '27e37540e2c6cb034823');
+<?php return array('dependencies' => array(), 'version' => 'd000a5c9efc720ffeec4');
--- a/custom-post-type-ui/custom-post-type-ui.php
+++ b/custom-post-type-ui/custom-post-type-ui.php
@@ -16,7 +16,7 @@
* Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
* Description: Admin UI panel for registering custom post types and taxonomies
* Author: WebDevStudios
- * Version: 1.18.0
+ * Version: 1.18.1
* Author URI: https://webdevstudios.com/
* Text Domain: custom-post-type-ui
* Domain Path: /languages
@@ -33,8 +33,8 @@
exit;
}
-define( 'CPT_VERSION', '1.18.0' ); // Left for legacy purposes.
-define( 'CPTUI_VERSION', '1.18.0' );
+define( 'CPT_VERSION', '1.18.1' ); // Left for legacy purposes.
+define( 'CPTUI_VERSION', '1.18.1' );
define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
/**
--- a/custom-post-type-ui/inc/about.php
+++ b/custom-post-type-ui/inc/about.php
@@ -86,26 +86,6 @@
do_action( 'cptui_main_page_before_changelog' );
?>
- <h2>
- <?php
- printf(
- // translators: Placeholder will hold the plugin version.
- esc_html__( "What's new in version %s", 'custom-post-type-ui' ),
- esc_html( CPTUI_VERSION )
- );
- ?>
- </h2>
- <div class="changelog about-integrations">
- <div class="cptui-feature feature-section col three-col">
- <div class="col">
- <h2><?php esc_html_e( 'Post type migration support', 'custom-post-type-ui' ); ?></h2>
- <p><?php esc_html_e( 'If you are trying to move post types into CPTUI, you can now mark as such to prevent slug conflicts notices.', 'custom-post-type-ui' ); ?></p>
- <h2><?php esc_html_e( 'Moved to minimum of WordPress 6.3.', 'custom-post-type-ui' ); ?></h2>
- <p><?php esc_html_e( 'The move to require WordPress 6.3 allowed for adding "item_trashed" label support.', 'custom-post-type-ui' ); ?></p>
- </div>
- </div>
- </div>
-
<div class="extranotes">
<?php
--- a/custom-post-type-ui/inc/post-types.php
+++ b/custom-post-type-ui/inc/post-types.php
@@ -1398,7 +1398,7 @@
'custom-post-type-ui'
),
sprintf(
- '<a href="https://developer.wordpress.org/reference/functions/register_post_type/#menu_position" target="_blank" rel="noopener">%s</a>',
+ '<a href="https://developer.wordpress.org/reference/functions/register_post_type/#menu_position" target="_blank">%s</a>',
esc_html__( 'Available options', 'custom-post-type-ui' )
)
)
@@ -1475,7 +1475,7 @@
'aftertext' => esc_attr__( '(Full URL for icon or Dashicon class)', 'custom-post-type-ui' ),
'helptext' => sprintf(
esc_html__( 'Image URL or %sDashicon class name%s to use for icon. Custom image should be 20px by 20px.', 'custom-post-type-ui' ), // phpcs:ignore.
- '<a href="https://developer.wordpress.org/resource/dashicons/" target="_blank" rel="noopener">',
+ '<a href="https://developer.wordpress.org/resource/dashicons/" target="_blank">',
'</a>'
),
'wrap' => false,
@@ -1524,7 +1524,7 @@
echo $ui->get_p(
sprintf(
- '<a href="%s" target="_blank" rel="noopener">%s</a><br/><a href="%s" target="_blank" rel="noopener">%s</a>',
+ '<a href="%s" target="_blank">%s</a><br/><a href="%s" target="_blank">%s</a>',
esc_url( 'https://developer.wordpress.org/reference/functions/add_theme_support/#post-thumbnails' ),
/* translators: Link text for WordPress Developer site. */
esc_html__( 'Theme support for featured images', 'custom-post-type-ui' ),
@@ -1709,7 +1709,7 @@
echo $ui->get_fieldset_end() . $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
echo $ui->get_tr_start() . $ui->get_th_start() . '<label for="custom_supports">' . esc_html__( 'Custom "Supports"', 'custom-post-type-ui' ) . '</label>'; // phpcs:ignore.
- echo $ui->get_p( sprintf( esc_html__( 'Use this input to register custom "supports" values, separated by commas. Learn about this at %s', 'custom-post-type-ui' ), '<a href="https://docs.pluginize.com/article/third-party-support-upon-registration/" target="_blank" rel="noopener">' . esc_html__( 'Custom "Supports"', 'custom-post-type-ui' ) . '</a>' ) ); // phpcs:ignore.
+ echo $ui->get_p( sprintf( esc_html__( 'Use this input to register custom "supports" values, separated by commas. Learn about this at %s', 'custom-post-type-ui' ), '<a href="https://docs.pluginize.com/article/third-party-support-upon-registration/" target="_blank">' . esc_html__( 'Custom "Supports"', 'custom-post-type-ui' ) . '</a>' ) ); // phpcs:ignore.
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
echo $ui->get_text_input( // phpcs:ignore.
[
@@ -2399,6 +2399,10 @@
*/
function cptui_process_post_type() {
+ if ( ! current_user_can( 'manage_options' ) ) {
+ return;
+ }
+
if ( wp_doing_ajax() ) {
return;
}
--- a/custom-post-type-ui/inc/support.php
+++ b/custom-post-type-ui/inc/support.php
@@ -141,7 +141,7 @@
<li>
<span tabindex="0" class="question" aria-controls="q9" aria-expanded="false"><?php esc_html_e( 'I changed my custom post type name and now I can not get to my posts. How do I get them back?', 'custom-post-type-ui' ); ?></span>
<div class="answer" id="q9"><?php esc_html_e( 'You can either change the custom post type name back to the original name or try the Post Type Switcher plugin', 'custom-post-type-ui' ); ?>
- <a href="https://wordpress.org/plugins/post-type-switcher/" target="_blank" rel="noopener">https://wordpress.org/plugins/post-type-switcher/</a>
+ <a href="https://wordpress.org/plugins/post-type-switcher/">https://wordpress.org/plugins/post-type-switcher/</a>
</div>
</li>
<li>
@@ -150,7 +150,7 @@
</li>
<li>
<span tabindex="0" class="question" aria-controls="q11" aria-expanded="false"><?php esc_html_e( 'I have added post thumbnail and/or post format support to my post type, but those do not appear when adding a post type post.', 'custom-post-type-ui' ); ?></span>
- <div class="answer" id="q11"><?php esc_html_e( 'Make sure your theme has post "post-thumbnails" theme support enabled.', 'custom-post-type-ui' ); ?> <a href="https://developer.wordpress.org/reference/functions/add_theme_support/" target="_blank" rel="noopener">https://developer.wordpress.org/reference/functions/add_theme_support/</a></div>
+ <div class="answer" id="q11"><?php esc_html_e( 'Make sure your theme has post "post-thumbnails" theme support enabled.', 'custom-post-type-ui' ); ?> <a href="https://developer.wordpress.org/reference/functions/add_theme_support/">https://developer.wordpress.org/reference/functions/add_theme_support/</a></div>
</li>
</ol>
</td>
@@ -166,7 +166,7 @@
printf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
esc_html__( 'Please visit the %1$sTemplate Hierarchy%2$s page on the WordPress codex for details about available templates.', 'custom-post-type-ui' ),
- '<a href="https://developer.wordpress.org/themes/basics/template-hierarchy/" target="_blank" rel="noopener">',
+ '<a href="https://developer.wordpress.org/themes/basics/template-hierarchy/">',
'</a>'
);
?>
@@ -184,7 +184,7 @@
'https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui',
'Custom Post Type UI Extended'
),
- '<a href="https://developer.wordpress.org/reference/classes/wp_query/" target="_blank" rel="noopener">WP_Query</a>'
+ '<a href="https://developer.wordpress.org/reference/classes/wp_query/">WP_Query</a>'
);
?>
</div>
@@ -196,7 +196,7 @@
printf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
esc_html__( 'You will need to add your newly created post type to the types that the category and tag archives query for. You can see a tutorial on how to do that at %s. You can also get this functionality via UI with a purchase of CPTUI-Extended', 'custom-post-type-ui' ),
- '<a href="https://docs.pluginize.com/article/post-types-in-category-tag-archives/" target="_blank" rel="noopener">https://docs.pluginize.com/article/post-types-in-category-tag-archives/</a>'
+ '<a href="https://docs.pluginize.com/article/post-types-in-category-tag-archives/">https://docs.pluginize.com/article/post-types-in-category-tag-archives/</a>'
);
?>
</div>
@@ -208,7 +208,7 @@
printf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
esc_html__( 'Please visit the %1$sPost Type Templates in 4.7%2$s post on the Make WordPress Core blog for details about setting templates for multiple post types.', 'custom-post-type-ui' ),
- '<a href="https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/" target="_blank" rel="noopener">',
+ '<a href="https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/">',
'</a>'
);
?>
@@ -234,7 +234,7 @@
printf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
esc_html__( 'We recommend checking out %s, the latest iteration of "CMB2". Both are supported by WebDevStudios.', 'custom-post-type-ui' ),
- '<a href="https://wordpress.org/plugins/cmb2/" target="_blank" rel="noopener">CMB2</a>'
+ '<a href="https://wordpress.org/plugins/cmb2/">CMB2</a>'
);
?>
</div>
@@ -246,7 +246,7 @@
printf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
esc_html__( 'Check out the %s function for documentation and usage examples.', 'custom-post-type-ui' ),
- '<a href="https://developer.wordpress.org/reference/functions/register_taxonomy_for_object_type/" target="_blank" rel="noopener">register_taxonomy_for_object_type()</a>'
+ '<a href="https://developer.wordpress.org/reference/functions/register_taxonomy_for_object_type/">register_taxonomy_for_object_type()</a>'
);
?>
</div>
@@ -257,11 +257,8 @@
<?php
printf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
- esc_html__( '%1$s has an excellent %2$spost%3$s introducing users to the %4$sPosts 2 Posts%5$s plugin that should be a good start.', 'custom-post-type-ui' ),
- 'Pippin Williamson',
- '<a href="https://pippinsplugins.com/introduction-posts-2-posts-plugin/" target="_blank" rel="noopener">',
- '</a>',
- '<a href="https://wordpress.org/plugins/posts-to-posts/" target="_blank" rel="noopener">',
+ esc_html__( 'We recommend the %1$sPosts 2 Posts%2$s plugin.', 'custom-post-type-ui' ),
+ '<a href="https://wordpress.org/plugins/posts-to-posts/">',
'</a>'
);
?>
@@ -287,7 +284,7 @@
printf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
esc_html__( 'We recommend %s for some extended customization and addition of extra fields regarding roles and capabilities.', 'custom-post-type-ui' ),
- '<a href="https://github.com/tw2113/custom-post-type-ui-capabilities" target="_blank" rel="noopener">Custom Post Type UI Capabilities on GitHub</a>'
+ '<a href="https://github.com/tw2113/custom-post-type-ui-capabilities">Custom Post Type UI Capabilities on GitHub</a>'
);
?>
</p>
--- a/custom-post-type-ui/inc/taxonomies.php
+++ b/custom-post-type-ui/inc/taxonomies.php
@@ -1983,6 +1983,10 @@
*/
function cptui_process_taxonomy() {
+ if ( ! current_user_can( 'manage_options' ) ) {
+ return;
+ }
+
if ( wp_doing_ajax() ) {
return;
}
--- a/custom-post-type-ui/inc/utility.php
+++ b/custom-post-type-ui/inc/utility.php
@@ -112,16 +112,16 @@
esc_attr__( '%1$s version %2$s by %3$s', 'custom-post-type-ui' ),
esc_attr__( 'Custom Post Type UI', 'custom-post-type-ui' ),
CPTUI_VERSION,
- '<a href="https://webdevstudios.com" target="_blank" rel="noopener">WebDevStudios</a>'
+ '<a href="https://webdevstudios.com">WebDevStudios</a>'
) . ' - ' .
sprintf(
// translators: Placeholders are just for HTML markup that doesn't need translated.
- '<a href="http://wordpress.org/support/plugin/custom-post-type-ui" target="_blank" rel="noopener">%s</a>',
+ '<a href="https://wordpress.org/support/plugin/custom-post-type-ui">%s</a>',
esc_attr__( 'Support forums', 'custom-post-type-ui' )
) . ' - ' .
sprintf(
// translators: Placeholders are just for HTML markup that doesn't need translated.
- '<a href="https://wordpress.org/plugins/custom-post-type-ui/reviews/" target="_blank" rel="noopener">%s</a>',
+ '<a href="https://wordpress.org/plugins/custom-post-type-ui/reviews/">%s</a>',
sprintf(
// translators: Placeholder will hold `<abbr>` tag for CPTUI.
esc_attr__( 'Review %s', 'custom-post-type-ui' ),
@@ -133,11 +133,11 @@
)
)
) . ' - ' .
- esc_attr__( 'Follow on Twitter:', 'custom-post-type-ui' ) .
+ esc_attr__( 'Follow on X:', 'custom-post-type-ui' ) .
sprintf(
// translators: Placeholders are just for HTML markup that doesn't need translated.
' %s',
- '<a href="https://twitter.com/webdevstudios" target="_blank" rel="noopener">WebDevStudios</a>'
+ '<a href="https://x.com/webdevstudios">WebDevStudios</a>'
);
}
add_filter( 'admin_footer_text', 'cptui_footer' );