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

CGit with Libravatar: value too long for type character varying(250) #386

Closed
rick-gnous opened this issue Feb 4, 2022 · 3 comments
Closed
Milestone

Comments

@rick-gnous
Copy link
Contributor

rick-gnous commented Feb 4, 2022

Some instances of CGit have a plugin for avatar using libravatar. It adds a span in the author field and, because of his length, raises "value too long for type character varying(250)". Check the code below to see the difference. I use the official cgit repo for example.

Without libravatar

<tr><th>author</th>
<td>Christian Hesse &lt;mail@eworm.de&gt;</td>
<td class="[right]()">2021-05-18 22:49:13 +0200</td></tr>
<tr><th>committer</th><td>Christian Hesse &lt;mail@eworm.de&gt;</td>
<td class="[right]()">2021-06-08 12:37:46 +0200</td></tr>

With libravatar

<tr><th>author</th>
<td><span class="[libravatar]()"><img class="[inline]()" src="[https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=13&amp;d=retro](view-source:https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=13&d=retro)"><img class="[onhover]()" src="[https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=128&amp;d=retro](view-source:https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=128&d=retro)"></span>Christian Hesse &lt;mail@eworm.de&gt;</td>
<td class="[right]()">2021-05-18 22:49:13 +0200</td></tr>
<tr><th>committer</th><td><span class="[libravatar]()"><img class="[inline]()" src="[https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=13&amp;d=retro](view-source:https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=13&d=retro)"><img class="[onhover]()" src="[https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=128&amp;d=retro](view-source:https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=128&d=retro)"></span>Christian Hesse &lt;mail@eworm.de&gt;</td>
<td class="[right]()">2021-06-08 12:37:46 +0200</td></tr>
@dregad dregad added this to the 2.5.0 milestone Feb 4, 2022
@dregad dregad linked a pull request Feb 4, 2022 that will close this issue
@dregad
Copy link
Member

dregad commented Feb 4, 2022

Actual error was reported in #377 (comment)

APPLICATION ERROR #401

Database query failed. Error received from database was #-1: ERROR: value too long for type character varying(250) for the query: INSERT INTO mantis_plugin_Source_changeset_table ( repo_id, revision, parent, branch, user_id,
timestamp, author, message, info, ported, author_email, committer, committer_email, committer_id
) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14 ).
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

@dregad dregad changed the title Libravatar CGit CGit with Libravatar: value too long for type character varying(250) Feb 4, 2022
@dregad
Copy link
Member

dregad commented Feb 4, 2022

I tried to use the sample output posted in #386 (comment) to test the regex in #377, but the HTML seems strange (e.g. added newlines, &lt; entity, class name looks like Markdown link, double quotes instead of single) and does not match with the patterns in the code.

For the record, I used the following, manually modified versions for testing - I hope they're actually correct Cgit output.

<tr><th>author</th><td>Christian Hesse <mail@eworm.de></td><td class='right'>2021-05-18 22:49:13 +0200</td></tr>
<tr><th>author</th><td><span class='libravatar'><img class='inline' src='https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=13&amp;d=retro'><img class='onhover' src='https://seccdn.libravatar.org/avatar/d39edb2018ca5544c1c390a8266096fb?s=128&amp;d=retro'></span>Christian Hesse <mail@eworm.de></td><td class='right'>2021-05-18 22:49:13 +0200</td></tr>

@rick-gnous
Copy link
Contributor Author

Yes, I've used the "View Selection Source" of Firefox to extract HTML. Good to know that it's reformat the code.

@dregad dregad closed this as completed in 7ae74a0 Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants