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

Miscellaneous fixes #1934

Merged
merged 9 commits into from
Oct 3, 2024
Merged

Miscellaneous fixes #1934

merged 9 commits into from
Oct 3, 2024

Conversation

hemberger
Copy link
Member

  • Notice about donation -> SMR credit processing time.
  • Fix some unescaped user input with htmlentities.
  • Prevent setting some database entries to values larger than the type allows.

Players were (reasonably) expecting their SMR credits to be processed
automatically, and were confused when they were not showing up. This
note at least notifies them that there will be a delay.
The `bounty.amount` column is an UNSIGNED INT in the database, and so
we need to prevent the value from increasing to beyond its maximum
value. Otherwise, we get a "value out of range" SQL error.
The `message_boxes.message_text` column is type TEXT, which has a limit
on the string length. When logging exceptions, make sure we restrict the
length of the message to this limit to avoid a database error.
This fixes libxml errors when the thread topic includes, e.g., an
ampersand.
The `account_has_ip.host` column is a varchar(64). Truncate the host if
it is too long to avoid a database error. The full host name is not
particularly important.
The `planet.password` and `planet.planet_name` columns are varchar(32),
so use HTML5 to restrict the user to 32 characters to avoid a database
error.
Use HTML5 to restrict the fontsize input to its (arbitrary) minimum
value and its (database-driven) maximum value. The type of the
`account.fontsize` column is UNSIGNED TINYINT.
Use HTML5 to prevent users from entering in an alliance name/description
that will result in a database error.
The `bar_tender.message` column is a VARCHAR(255), so limit the message
length to 255 to avoid a database error.
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 31.49%. Comparing base (04d9546) to head (e6da88d).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/Smr/Account.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1934   +/-   ##
=========================================
  Coverage     31.48%   31.49%           
- Complexity     4202     4203    +1     
=========================================
  Files           125      125           
  Lines         12718    12718           
=========================================
+ Hits           4004     4005    +1     
+ Misses         8714     8713    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hemberger hemberger merged commit b370263 into smrealms:main Oct 3, 2024
8 checks passed
@hemberger hemberger deleted the misc-fixes branch October 3, 2024 06:41
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.

1 participant