From 8bb9e0da484cb944e216726a32e010ab59bed971 Mon Sep 17 00:00:00 2001 From: geoffff Date: Wed, 22 Dec 2021 16:23:06 -0800 Subject: Update paginator.py Use str.startswith('/') to check whether 'ret' starts with a slash. The original code fails when 'ret' is an empty string, such as when INDEX_URL is set to "". --- pelican/paginator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pelican/paginator.py') diff --git a/pelican/paginator.py b/pelican/paginator.py index 7e738fe3..4231e67b 100644 --- a/pelican/paginator.py +++ b/pelican/paginator.py @@ -155,7 +155,7 @@ class Page: # changed to lstrip() because that would remove all leading slashes and # thus make the workaround impossible. See # test_custom_pagination_pattern() for a verification of this. - if ret[0] == '/': + if ret.startswith('/'): ret = ret[1:] return ret -- cgit v1.2.1