Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for /index on pages' slug #6789

Merged
merged 5 commits into from Mar 18, 2020
Merged

Check for /index on pages' slug #6789

merged 5 commits into from Mar 18, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Mar 17, 2020

Closes #4638 (last use of project.documentation_type here)
Fixes #5254

@stsewd stsewd requested a review from Mar 17, 2020
Copy link
Member

@humitos humitos left a comment

Makes sense to me!

if main_project.documentation_type == 'sphinx_htmldir':
path = page_slug + '/'
if version.documentation_type == 'sphinx_htmldir':
path = re.sub('/index$', '', page_slug) + '/'
Copy link
Member

@humitos humitos Mar 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use the regex module that has timeout here?

Copy link
Member Author

@stsewd stsewd Mar 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regex are dangerous when the user provides the pattern, this pattern is simple enough.

@stsewd stsewd merged commit 2b47c40 into master Mar 18, 2020
3 checks passed
@stsewd stsewd deleted the fix-index-file-htmldir branch Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants