Page MenuHomePhabricator

A signature can not be detected by DiscussionTools
Closed, ResolvedPublicBUG REPORT

Description

https://zh.wikipedia.org/w/index.php?oldid=69993162&uselang=en#%E5%A6%82%E4%BD%95%E7%94%B3%E8%AF%B7%E7%A7%BB%E5%8A%A8%E6%9D%A1%E7%9B%AE%E6%97%B6%E4%B8%8D%E7%95%99%E9%87%8D%E5%AE%9A%E5%90%91%E7%9A%84%E6%9D%83%E9%99%90%EF%BC%9F

Capture.JPG (265×1 px, 168 KB)

There is no reply link for this signature:
[[User:50829!|<math>8.7638\,</math>]][[Special:用户贡献/50829!|<math>\times</math>]][[User talk:50829!|<math>\,10^{217134}</math>]]
Is this signature illegal?

Event Timeline

I don't think it's illegal, this looks like a bug in our code.

The signature generates very long HTML output like this (because wikitext <math> tags generate hidden markup in different formats for accessibility):

--<a rel="mw:WikiLink" href="./User:50829!" title="User:50829!" id="mwAoE"><span class="mwe-math-element" typeof="mw:Extension/math" about="#mwt93" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"8.7638\\,"}}' id="mwAoI"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 8.7638\,}">
  <semantics>
    <mrow class="MJX-TeXAtom-ORD">
      <mstyle displaystyle="true" scriptlevel="0">
        <mn>8.7638</mn>
        <mspace width="thinmathspace"></mspace>
      </mstyle>
    </mrow>
    <annotation encoding="application/x-tex">{\displaystyle 8.7638\,}</annotation>
  </semantics>
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8096a8d91a7b19784ffe4f9903f265d4c1e3a568" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.338ex; width:6.846ex; height:2.176ex;" alt="{\displaystyle 8.7638\,}"/></span></a><a rel="mw:WikiLink" href="./Special:用户贡献/50829!" title="Special:用户贡献/50829!" id="mwAoM"><span class="mwe-math-element" typeof="mw:Extension/math" about="#mwt94" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"\\times"}}' id="mwAoQ"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \times }">
  <semantics>
    <mrow class="MJX-TeXAtom-ORD">
      <mstyle displaystyle="true" scriptlevel="0">
        <mo>×<!-- × --></mo>
      </mstyle>
    </mrow>
    <annotation encoding="application/x-tex">{\displaystyle \times }</annotation>
  </semantics>
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0ffafff1ad26cbe49045f19a67ce532116a32703" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: 0.019ex; margin-bottom: -0.19ex; width:1.808ex; height:1.509ex;" alt="\times"/></span></a><a rel="mw:WikiLink" href="./User_talk:50829!" title="User talk:50829!" id="mwAoU"><span class="mwe-math-element" typeof="mw:Extension/math" about="#mwt95" data-mw='{"name":"math","attrs":{},"body":{"extsrc":"\\,10^{217134}"}}' id="mwAoY"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \,10^{217134}}">
  <semantics>
    <mrow class="MJX-TeXAtom-ORD">
      <mstyle displaystyle="true" scriptlevel="0">
        <mspace width="thinmathspace"></mspace>
        <msup>
          <mn>10</mn>
          <mrow class="MJX-TeXAtom-ORD">
            <mn>217134</mn>
          </mrow>
        </msup>
      </mstyle>
    </mrow>
    <annotation encoding="application/x-tex">{\displaystyle \,10^{217134}}</annotation>
  </semantics>
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cf062a7d0ab396d81523bb15d483c73dd6aa215b" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.338ex; width:7.876ex; height:2.676ex;" alt="{\displaystyle \,10^{217134}}"/></span></a> 2022年1月31日 (一) 05:55 (UTC)

In our code, we have a limit on the length of a signature, and when processing this, we hit the limit before we find the user page links.

The limit is only intended to prevent weird markup from slowing down our parser too much, and it's not a policy on what should be allowed, so we should probably adjust how this markup is counted against the limit.

Change 759735 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Don't count leading/trailing whitespace against signature scan limit

https://gerrit.wikimedia.org/r/759735

Change 759735 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Don't count leading/trailing whitespace against signature scan limit

https://gerrit.wikimedia.org/r/759735

I feel like image/extension signatures should be not allowed...

@Esanders I'm not sure how I feel about them myself, but IMO it's a matter for each wiki's policy, since it's easy for us to support them. And it looks like <math> in signatures is quite common on zh.wp: https://zh.wikipedia.org/w/index.php?search=talk%3A+insource%3A%2F%5C<math%2F&title=Special:搜索&profile=advanced&fulltext=1&ns0=1

Looks good to me now:

Screenshot 2022-02-09 at 18.51.19.png (676×3 px, 213 KB)

Long signatures seem to work fine now.

EAkinloose added a project: Editing QA.
EAkinloose moved this task from QA to Ready for Sign Off on the Editing-team (Kanban Board) board.
EAkinloose removed a project: Editing QA.