summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeoffff <github@8pup.net>2021-12-22 16:23:06 -0800
committerJustin Mayer <entroP@gmail.com>2023-04-20 11:34:38 +0200
commit8bb9e0da484cb944e216726a32e010ab59bed971 (patch)
treee13d593222529eb98885ec41f1ae79853e8e022a
parent208332c0e6441b1975ffb3a9de4137e578a1ecfd (diff)
downloadpelican-8bb9e0da484cb944e216726a32e010ab59bed971.tar.gz
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 "".
-rw-r--r--pelican/paginator.py2
1 files changed, 1 insertions, 1 deletions
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