Bug #23126 Version Retired

Forum search crashes when reply snippets end with quote/apostrophe

Version: 2.11.9 Reporter: MID

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

(Forum 3.1.22)

When a search finds a reply, where there is a single or double quote at the 30th character, the results page is not fully rendered.

Removing the {snippet} tag from reply_results.html, or editing the post to change the position of the quote, both allow the page to be displayed.

  • Can you share your forum theme’s reply_results.html template in full please? In the default theme, {snippet} is not used in a tag parameter, so quotes should not have any impact.

    Derek Jones
    30th May, 2017 at 10:39am
  • I tested with the default template, which is:

    <li><a href="http://{path:viewreply}">{snippet}…</a> {lang:by} <a href="http://{path:member_profile}">{author}</a></li>
    30th May, 2017 at 10:45am
  • I am unable to reproduce, and do not readily see how any character in that content would be breaking the markup and the page rendering.

    Can you please give me steps to reproduce using the default theme? I have tried replying with single and double quotes at the 30th, and all other positions within the first portion of the reply that is used in the snippet, and it renders as expected.

    Derek Jones
    30th May, 2017 at 10:53am
  • That’s odd. I could reproduce it consistently on searches, wherever either of two problematic replies were found. One of them began,

    1. It used to be the DWP’s policy that it would suspend recovery if an in-time appeal had been made and recovery had not yet begun.

    I have tweaked both of these replies now to work around the issue, or I would be able to point you at a live example! If you’d like to take a look, I can try to reverse the edit?

    (PS not sure why the tracker has added


    to the template above!)

    30th May, 2017 at 11:05am
  • I have tweaked both of these replies now to work around the issue, or I would be able to point you at a live example! If you’d like to take a look, I can try to reverse the edit?

    Can you just paste the reply here in a code sample that is causing the issue for you if it differs from the above? I see a curly quote in there now, that may be a clue.

    not sure why the tracker has added `http://` to the above

    We have some safe HTML settings here due to some spam that tries to normalize markup. It detected your link’s href not having a protocol, and added it in, sorry about that.

    Derek Jones
    30th May, 2017 at 11:22am
  • Here is the post, before editing (as much as the bug tracker will let me submit). I removed the spaces towards the beginning and replaced the smart quote with a dumb one to fix this on the site.

    1.      It used to be the DWP’s policy that it would suspend recovery if an in-time appeal had been made and recovery had not yet begun. Where recovery had already commenced, or where an appeal was made out of time but accepted as a late appeal, the policy was to continue with recovery. In practice, it would often suspend recovery even in these circumstances where a request for the same was made. However, what happened in practice very often depended upon which office was dealing with the appeal and recovery – and once the department moved the administration of recovery to the various Debt Recovery Centres there was no consistency of policy at all.
    Policy, such as it was can be found in the Overpayment Recovery Guide. It is not now available on the DWP website and was last updated in 2005. I have a copy if you wish, but I am unsure that I would wish to rely on it – aside from being out of date, it is only guidance and no authoritative statement as to the law.
    2.      The issue of whether the department is able to recover whilst an appeal remains to be determined is not something that has received a significant amount of attention in caselaw – decisions have focused on the issues of whether a claimant has in fact been overpaid or whether a particular overpayment is recoverable.
    There is, however, one decision which may be of use – [b]R(SB) 5/91[/b]. That decision was concerned with whether section 9 (1) of the Limitation Act 1980 applied before an overpayment was found to be recoverable – i.e. the claimant argued that in computing any overpayment the calculation was unable to go back more than 6 years. The appeal was dismissed and Commissioner Rice held that it was only once the amount of an overpayment had finally been determined that time begins to run for the purposes of the Limitation Act. Nevertheless, what he also said about when the Secretary of State may recover is of relevance;
          6.   The same question which came before the tribunal appears to have been ventilated in an earlier case CSB/1158/1982, where    
                at paragraph 9 the learned Commissioner stated as follows:
                   “9 . . . . in my judgment the Limitation Act has no relevance. Recovery under section 20 (which is for the Secretary of State 
                               alone) only arises once the adjudicating authorities have determined there is a recoverable amount and have 
                               determined what it is. That is the sole jurisdiction of the adjudicating authorities. They are not concerned with whether  
                               money can or should be recovered, see paragraph 4 of R(SB) 44/83.”
    The Commissioner then went on to point out that time began to run within section 9(1) only after the appellate procedure had been exhausted:
              “Accordingly until adjudication is complete the Secretary of State has no right to recover. It is only from then that the Limitation 
               Act period will apply as only then does the Secretary of State’s right of action accrue. To accept that notification of the date of the 
              adjudication officer’s decision as the relevant date will mean that the Secretary of State was entitled as of that moment to 
              recover notwithstanding that there was an appeal in progress. It would not I think be the intention of Parliament to provide for 
              appeals against an initial determination if such were the case . . .”
    Commissioner Rice was clearly quoting with approval those passages from [i]CSB/1158/1982[/i] to the effect that the Secretary of State had no power of recovery until the adjudication and appeal process was complete – or at least assumes them to be uncontroversial.
    The difficulty is that R(SB) 5/91 was dealing with the old supplementary benefit scheme under which not only was recovery (including issues regarding the exercise of discretion in deciding whether to recover) a matter for Secretary of State, but the SoS was an entity entirely distinct from and unable to interfere in the adjudication process – adjudication officers were legally independent of the SoS, whereas under the Social Security Act 1998, a decision maker is, at least for decision making purposes, that same SoS. Given this fundamental change in the legislation, R(SB) 5/91 is probably now no more than persuasive authority for the proposition that Parliament would not have provided for appeals against a decision if the Secretary of State had the power to recover immediately from the date of the decision of a DM. Certainly, there is no express provision in the legislation to prevent recovery commencing whilst an appeal is pending.
    30th May, 2017 at 11:31am
  • Yep, that’s the issue, the curly quote. I’m guessing this was cut/paste from a document with smart quotes. The forums typography automatically adds HTML smart quote entities for you from single and double quotes, and aren’t affected this way. But if your content already includes a multi-byte character, it’s causing a problem at that specific position in the string. PHP’s substr() can’t handle multi-byte strings correctly, sadly, and its multi-byte functions aren’t always available. This is a legitimate bug however, thank you for reporting and sticking with me.

    Derek Jones
    30th May, 2017 at 11:34am
  • Thank you!

    30th May, 2017 at 11:37am
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases