Skip to content

Commit 8efdef6

Browse files
committed
Add additional check for bulk edit nonce.
1 parent f0bd491 commit 8efdef6

File tree

6 files changed

+48
-36
lines changed

6 files changed

+48
-36
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
Notable changes and release notes of the Mark Posts WordPress plugin.
44

5+
## 2.2.6
6+
* Fixes a bug where the bulk edit nonce is not set
7+
Thanks to René Eger for finding and reporting the issue
8+
59
## 2.2.5
610
* Adds additional user capability checks (quick edit and bulk edit)
711
* Adds Laravel Pint code style fixer as a developer dependency
812

913
## 2.2.4
10-
* Adds support for the [WordPress playground](https://playground.wordpress.net/?plugin=mark-posts)
14+
* Adds support for the [WordPress playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/hofmannsven/mark-posts/master/.wordpress-org/blueprint.json)
1115
* Hides new internal post types by default
1216
* Fixes broken access control vulnerability
1317
Thanks @truonghuuphuc for discovering and responsibly disclosing this vulnerability

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Mark Posts plugin provides an easy way to mark and highlight posts, pages and po
1717
* Dashboard widget with marker status count
1818
* Optional custom setup via filters (check our [wiki](https://github.com/hofmannsven/mark-posts/wiki) for instructions)
1919

20+
## Live Demo
21+
22+
Try out the features of Mark Posts on the [WordPress playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/hofmannsven/mark-posts/master/.wordpress-org/blueprint.json).
23+
2024
## Looking ahead
2125

2226
Check our [roadmap](https://github.com/hofmannsven/mark-posts/projects/1) for planned tasks and active issues regarding the further development of the plugin.
@@ -63,9 +67,13 @@ Please read the [changelog](CHANGELOG.md) for more information about what has ch
6367

6468
Please read the [contribution guidelines](CONTRIBUTING.md) for details.
6569

70+
## Translation
71+
72+
If you'd like to help translate this plugin, you can do so on [WordPress Translate](https://translate.wordpress.org/projects/wp-plugins/mark-posts/).
73+
6674
## Support
6775

68-
Always feel free to [raise an issue](https://github.com/hofmannsven/mark-posts/issues) on GitHub.
76+
Active development of this plugin is handled on GitHub. Always feel free to [raise an issue](https://github.com/hofmannsven/mark-posts/issues).
6977

7078
## Security
7179

README.txt

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
=== Mark Posts ===
2-
Contributors: hofmannsven, flymke
2+
Contributors: hofmannsven
33
Tags: highlight, color, status, tag, featured
44
Requires at least: 4.1
55
Tested up to: 6.7
66
Requires PHP: 7.0
7-
Stable tag: 2.2.5
7+
Stable tag: 2.2.6
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.txt
1010

@@ -23,6 +23,10 @@ Mark Posts plugin provides an easy way to mark and highlight posts, pages and po
2323
* Dashboard widget with marker status count
2424
* Optional custom setup via filters (check our [wiki](https://github.com/hofmannsven/mark-posts/wiki) for instructions)
2525

26+
= Live Demo =
27+
28+
Try out the features of Mark Posts on the [WordPress playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/hofmannsven/mark-posts/master/.wordpress-org/blueprint.json).
29+
2630
== Installation ==
2731

2832
= Requirements =
@@ -51,7 +55,7 @@ Using the latest version of WordPress and PHP is highly recommended.
5155

5256
== Support ==
5357

54-
Always feel free to [raise an issue](https://github.com/hofmannsven/mark-posts/issues) on GitHub.
58+
Active development of this plugin is handled on GitHub. Always feel free to [raise an issue](https://github.com/hofmannsven/mark-posts/issues).
5559

5660
== Frequently Asked Questions ==
5761

@@ -81,7 +85,7 @@ Always feel free to [raise an issue](https://github.com/hofmannsven/mark-posts/i
8185

8286
= Where can I get more information and support for this plugin? =
8387

84-
Visit [Mark Posts on Github](https://github.com/hofmannsven/mark-posts).
88+
Visit [Mark Posts on GitHub](https://github.com/hofmannsven/mark-posts).
8589

8690
== Screenshots ==
8791

@@ -93,12 +97,16 @@ Visit [Mark Posts on Github](https://github.com/hofmannsven/mark-posts).
9397

9498
== Changelog ==
9599

100+
= 2.2.6 =
101+
* Fixes a bug where the bulk edit nonce is not set
102+
Thanks to René Eger for finding and reporting the issue
103+
96104
= 2.2.5 =
97105
* Adds additional user capability checks (quick edit and bulk edit)
98106
* Adds Laravel Pint code style fixer as a developer dependency
99107

100108
= 2.2.4 =
101-
* Adds support for the [WordPress playground](https://playground.wordpress.net/?plugin=mark-posts)
109+
* Adds support for the [WordPress playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/hofmannsven/mark-posts/master/.wordpress-org/blueprint.json)
102110
* Hides new internal post types by default
103111
* Fixes broken access control vulnerability
104112
Thanks @truonghuuphuc for discovering and responsibly disclosing this vulnerability
@@ -131,21 +139,5 @@ Visit [Mark Posts on Github](https://github.com/hofmannsven/mark-posts).
131139
* Breaking change: Markers are no longer public by default
132140
* Adds [`mark_posts_taxonomy_args`](https://github.com/hofmannsven/mark-posts/wiki/Custom-Marker-Taxonomy-Arguments) filter
133141

134-
= 1.2.4 =
135-
* Fixes a bug with WordPress 5.5.1
136-
137-
= 1.2.3 =
138-
* Excludes specific internal plugin post types per default
139-
140-
= 1.2.2 =
141-
* Sets the minimum required PHP version to PHP 7.0
142-
143-
= 1.2.1 =
144-
* Excludes internal post types per default
145-
* Adds [`mark_posts_excluded_post_types`](https://github.com/hofmannsven/mark-posts/wiki/Reset-Custom-Post-Types) filter
146-
147-
= 1.2.0 =
148-
* Migrates GitHub repository to [hofmannsven/mark-posts](https://github.com/hofmannsven/mark-posts)
149-
* Adds Composer support
150-
151-
Check our [changelog](https://github.com/hofmannsven/mark-posts/blob/master/CHANGELOG.md) for previous releases.
142+
= Earlier versions =
143+
Check out our [full changelog](https://github.com/hofmannsven/mark-posts/blob/master/CHANGELOG.md) for previous releases

admin/class-mark-posts-admin.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,11 @@ public function mark_posts_display_quickedit_box(string $column_name)
418418
* Save quick edit.
419419
*
420420
* @param int $post_id ID of the post e.g. '1'
421-
* @param WP_Post $post Information about the post e.g. 'post_type'
422421
* @return void
423422
*
424423
* @since 1.0.0
425424
*/
426-
public function mark_posts_save_quick_edit(int $post_id, WP_Post $post)
425+
public function mark_posts_save_quick_edit(int $post_id)
427426
{
428427
// Pointless if $_POST is empty (this happens on bulk edit).
429428
if (empty($_POST)) {
@@ -440,13 +439,13 @@ public function mark_posts_save_quick_edit(int $post_id, WP_Post $post)
440439
return;
441440
}
442441

443-
// Don't mark_posts_save for autosave.
442+
// Skip autosave.
444443
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
445444
return;
446445
}
447446

448-
// Don't mark_posts_save for revisions.
449-
if (isset($post->post_type) && $post->post_type === 'revision') {
447+
// Skip revisions.
448+
if (wp_is_post_revision($post_id)) {
450449
return;
451450
}
452451

@@ -480,7 +479,7 @@ public function mark_posts_save_quick_edit(int $post_id, WP_Post $post)
480479
public function mark_posts_save_bulk_edit(int $post_id)
481480
{
482481
// Verify bulk edit nonce.
483-
if (! wp_verify_nonce($_REQUEST['_wpnonce'], 'bulk-posts')) {
482+
if (! isset($_REQUEST['_wpnonce']) || ! wp_verify_nonce($_REQUEST['_wpnonce'], 'bulk-posts')) {
484483
return;
485484
}
486485

@@ -489,6 +488,16 @@ public function mark_posts_save_bulk_edit(int $post_id)
489488
return;
490489
}
491490

491+
// Skip autosave.
492+
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
493+
return;
494+
}
495+
496+
// Skip revisions.
497+
if (wp_is_post_revision($post_id)) {
498+
return;
499+
}
500+
492501
// Get selected marker ID.
493502
$marker_id = (int) ! empty($_REQUEST['mark_posts_term_id']) ? $_REQUEST['mark_posts_term_id'] : 0;
494503

admin/views/admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ function mark_posts_show_settings()
373373
<div class="mark-posts-copy">
374374
<hr/>
375375
Mark Posts | Version: <?php echo WP_MARK_POSTS_VERSION; ?> | &copy; <?php echo date('Y'); ?>
376-
<a href="http://www.aliquit.de" target="_blank">Michael Schoenrock</a>,
377-
<a href="https://hofmannsven.com" target="_blank">Sven Hofmann</a>
376+
<a href="http://www.aliquit.de" target="_blank" rel="noopener">Michael Schoenrock</a>,
377+
<a href="https://hofmannsven.com" target="_blank" rel="noopener">Sven Hofmann</a>
378378
</div>
379379

380380
</div>

mark-posts.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
* Plugin Name: Mark Posts
55
* Description: Mark and highlight posts, pages and posts of custom post types within the posts overview.
66
* Plugin URI: https://wordpress.org/plugins/mark-posts
7-
* Version: 2.2.5
7+
* Version: 2.2.6
88
* Author: Sven Hofmann & Michael Schoenrock
99
* Author URI: https://hofmannsven.com
1010
* Contributor: Michael Schoenrock
1111
* Contributor URI: https://www.halloecho.de
1212
* License: GPL-2.0+
1313
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
1414
* Text Domain: mark-posts
15-
* GitHub URI: https://github.com/hofmannsven/mark-posts
1615
*/
1716

1817
// If this file is called directly, abort.
@@ -29,7 +28,7 @@
2928
*
3029
*/
3130
if (! defined('WP_MARK_POSTS_VERSION')) {
32-
define('WP_MARK_POSTS_VERSION', '2.2.5');
31+
define('WP_MARK_POSTS_VERSION', '2.2.6');
3332
}
3433

3534
/*

0 commit comments

Comments
 (0)