function hook_content_lock_path_protected in Content locking (anti-concurrent editing) 7.3
Same name and namespace in other branches
- 7.2 content_lock.api.php \hook_content_lock_path_protected()
Control protected paths for node edit forms.
The hook is typically implemented to check if a path should be protected for CSRF attacks on the node edit forms.
Parameters
string $path: The path to check protection for.
Return value
bool TRUE is the path should be protected. Note: this grant is permissive rather than restrictive.
See also
1 function implements hook_content_lock_path_protected()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
1 invocation of hook_content_lock_path_protected()
- content_lock_is_path_protected in ./
content_lock.module - Check if an internal Drupal path should be protected with a token.
File
- ./
content_lock.api.php, line 34 - Document content_lock hooks.
Code
function hook_content_lock_path_protected($path) {
if (strpos($path, 'node/') === 0) {
$paths_patterns = array(
'node/*/edit',
'node/*/edit/*',
'node/*/revisions/*/revert',
);
foreach ($paths_patterns as $protected_pattern) {
if (drupal_match_path($path, $protected_pattern)) {
return TRUE;
}
}
}
}