fix(routing): accommodate longer DOI prefixes in URLs
Modified the DOI rewrite rule to accept prefixes with more than four digits. This change ensures compatibility with a wider range of DOIs, preventing potential 404 errors and improving the robustness of URL parsing.
This commit is contained in:
parent
85ce309dc2
commit
1d2734bf00
1 changed files with 1 additions and 1 deletions
|
@ -372,7 +372,7 @@ add_action('save_post', 'save_article_meta_boxes');
|
|||
|
||||
function add_doi_rewrite_rule()
|
||||
{
|
||||
add_rewrite_rule('^([0-9]{2})\.([0-9]{4})/([a-zA-Z0-9_\-\/]+)?$', 'index.php?doi=$matches[1].$matches[2]/$matches[3]', 'top');
|
||||
add_rewrite_rule('^([0-9]{2})\.([0-9]{4,})/([a-zA-Z0-9_\-\/]+)?$', 'index.php?doi=$matches[1].$matches[2]/$matches[3]', 'top');
|
||||
}
|
||||
|
||||
add_action('init', 'add_doi_rewrite_rule');
|
||||
|
|
Loading…
Reference in a new issue