Skip to content

Commit

Permalink
Fix issue Yoast#492
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Dec 26, 2013
1 parent 6817229 commit 82083eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inc/wpseo-non-ajax-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,12 @@ function allow_custom_field_edits( $allcaps, $cap, $args ) {

// Make sure the request is to edit or add a post meta (this is usually also the second value in $cap,
// but this is safer to check).
if ( in_array( $args[0], array( "edit_post_meta", "add_post_meta" ) ) ) {
if ( in_array( $args[0], array( 'edit_post_meta', 'add_post_meta' ) ) ) {
// Only allow editing rights for users who have the rights to edit this post and make sure
// the meta value starts with _yoast_wpseo.
if ( current_user_can( 'edit_post', $args[2] ) && ( ! empty( $args[3] ) && strpos( $args[3], "_yoast_wpseo_" ) === 0 ) )
if ( ( isset( $args[2] ) && current_user_can( 'edit_post', $args[2] ) ) && ( ( isset( $args[3] ) && $args[3] !== '' ) && strpos( $args[3], '_yoast_wpseo_' ) === 0 ) ) {
$allcaps[$args[0]] = true;
}
}

return $allcaps;
Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ You'll find the [FAQ on Yoast.com](http://yoast.com/wordpress/seo/faq/).

== Changelog ==

= Trunk =

* Bugfixes
* Fix issue with user capability authorisation check as reported by [scienceandpoetry](https://github.com/scienceandpoetry) in issue [#492](https://github.com/Yoast/wordpress-seo/issues/492) - props [Jrf](http://profiles.wordpress.org/jrf).

= 1.4.22 =

* Bugfixes
Expand Down

0 comments on commit 82083eb

Please sign in to comment.