Gitea: Phone number will lost last number

Created on 18 Apr 2019  路  3Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref):1.7.6
  • Git version:
  • Operating system:win 2012
  • Database (use [x]):

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [ ] Not relevant

  • Log gist:

Description

The phone number will lost last number in issues,such as I want 12475554522 but actually shows is 1247555452
This is edit number:
image
This is sure number after save.
image
The last number lost.

kinbug revieweconfirmed

Most helpful comment

This is because Gitea (and Github) look for a string of numbers (and/optional letters a-f) that are 7-40 char in length and see it as a SHA has value and link it using a truncated version of the value. You pretty much can't use any text that would also be part of a valid SHA, unfortunately.

Github is less error prone for a case like this because it actually does a lookup to see if the SHA exists (Gitea just matches the pattern and creates a link to avoid the lookup).

All 3 comments

This is because Gitea (and Github) look for a string of numbers (and/optional letters a-f) that are 7-40 char in length and see it as a SHA has value and link it using a truncated version of the value. You pretty much can't use any text that would also be part of a valid SHA, unfortunately.

Github is less error prone for a case like this because it actually does a lookup to see if the SHA exists (Gitea just matches the pattern and creates a link to avoid the lookup).

There is a temporary solution add the ` on both sides of the number then it will not as a SHA value.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakimfett picture jakimfett  路  3Comments

thehowl picture thehowl  路  3Comments

flozz picture flozz  路  3Comments

Fastidious picture Fastidious  路  3Comments

tuxfanou picture tuxfanou  路  3Comments