mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
don't shorten invalid urls
This commit is contained in:
parent
3871691ea4
commit
20a17c9fb7
1 changed files with 4 additions and 1 deletions
|
@ -492,7 +492,10 @@ def shorten_string(input_str, max_length=50):
|
||||||
|
|
||||||
|
|
||||||
def shorten_url(input: str, max_length=20):
|
def shorten_url(input: str, max_length=20):
|
||||||
return shorten_string(input.replace('https://', '').replace('http://', ''))
|
if input:
|
||||||
|
return shorten_string(input.replace('https://', '').replace('http://', ''))
|
||||||
|
else:
|
||||||
|
''
|
||||||
|
|
||||||
|
|
||||||
# the number of digits in a number. e.g. 1000 would be 4
|
# the number of digits in a number. e.g. 1000 would be 4
|
||||||
|
|
Loading…
Reference in a new issue