<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:#1F4E79;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F4E79">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79">When creating a dropoff request, if the subject is greater than $maxSubjectLength characters in length, ZendTo will crash with a 500 server error, and the following report:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">[23-May-2024 13:35:46 UTC] PHP Warning:  Undefined variable $d in /local/www/ZendTo-6.13-3/lib/Req.php on line 343<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">[23-May-2024 13:35:46 UTC] PHP Warning:  Undefined variable $d in /local/www/ZendTo-6.13-3/lib/Req.php on line 343<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">[23-May-2024 13:35:46 UTC] PHP Fatal error:  Uncaught ValueError: Unknown format specifier " " in /local/www/ZendTo-6.13-3/lib/Req.php:343<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">Stack trace:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">#0 /local/www/ZendTo-6.13-3/lib/Req.php(343): sprintf('Your subject li...', 145, 100)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">#1 /local/www/ZendTo-6.13-3/lib/Req.php(85): Req->initWithFormData('me@example.com')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">#2 /local/www/ZendTo-6.13-3/www/req.php(370): Req->__construct(Object(NSSDropbox), 'me@example.com')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">#3 {main}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">  thrown in /local/www/ZendTo-6.13-3/lib/Req.php on line 343<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79">The culprit is line 343 of Req.php:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">if ($subjectlength>$maxlen) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">  return sprintf(gettext("Your subject line to the recipients is %1$d characters long. It must be less than %2$d."), $subjectlength, $maxlen).' '.$BACKBUTTON;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New"">}</span><span style="color:#1F4E79"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79">Firstly it seems that the double-quotes around the string causes the printf format specifiers to fail. Change those to single quotes and the problem changes. The page no longer causes a 500 error but reports
 a friendlier ‘Request Error’ without actually explaining what the problem is. The ‘Your subject line to the recipients … is too long’ message is not included.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79">Removing the check altogether allows the request to complete, so it doesn’t appear that the max character subject limit is necessarily a problem. I’ve only been testing with a max length of about 100 characters
 though.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79">Not a show stopper, I’ve just bumped up the value of $maxSubjectLength in preferences.php from 100 to 200 in our case.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79">My installation is running ZendTO 6.13-3 on CentOS 7 with our own build of PHP 8.2.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79;mso-fareast-language:EN-GB">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F4E79;mso-fareast-language:EN-GB">Liam<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F4E79;mso-fareast-language:EN-GB"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span style="color:#C00000;mso-fareast-language:EN-GB">Liam Gretton</span></b><b><span style="color:#1F497D;mso-fareast-language:EN-GB"><br>
Research Technology Services Manager<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:8.0pt;color:#1F497D;mso-fareast-language:EN-GB"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-GB">Digital Services,
<br>
University of Leicester </span><span style="color:#C00000;mso-fareast-language:EN-GB">|</span><span style="color:#1F497D;mso-fareast-language:EN-GB"> University Road
</span><span style="color:#C00000;mso-fareast-language:EN-GB">|</span><span style="color:#1F497D;mso-fareast-language:EN-GB"> Leicester</span><span style="color:#C00000;mso-fareast-language:EN-GB">|</span><span style="color:#1F497D;mso-fareast-language:EN-GB">
 LE1 7RH </span><span style="color:#C00000;mso-fareast-language:EN-GB">|</span><span style="color:#1F497D;mso-fareast-language:EN-GB"> UK
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#1F497D;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="color:#C00000;mso-fareast-language:EN-GB">t:
</span></b><span style="color:#1F497D;mso-fareast-language:EN-GB">+44 116 252 2254</span><b><span style="color:#C00000;mso-fareast-language:EN-GB"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;text-autospace:none"><b><span style="color:#C00000;mso-fareast-language:EN-GB">e:</span></b><span style="color:#C00000;mso-fareast-language:EN-GB"> 
</span><a href="mailto:liam.gretton@leicester.ac.uk"><span style="color:#0563C1;mso-fareast-language:EN-GB">liam.gretton@leicester.ac.uk</span></a><span style="color:#1F497D;mso-fareast-language:EN-GB"><br>
</span><b><span style="color:#C00000;mso-fareast-language:EN-GB">w:</span></b><span style="color:#1F497D;mso-fareast-language:EN-GB">
</span><a href="http://www.le.ac.uk/"><span style="color:blue;mso-fareast-language:EN-GB">www.le.ac.uk</span></a><span style="color:#1F497D;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;text-autospace:none"><span style="color:#1F3864;mso-fareast-language:EN-GB"><img border="0" width="450" height="52" style="width:4.6875in;height:.5416in" id="Picture_x0020_3" src="cid:image001.png@01DAAD21.89265E10"></span><span style="color:#1F497D;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D;mso-fareast-language:EN-GB">Follow us on
</span><a href="https://twitter.com/uniofleicester"><span style="color:blue;mso-fareast-language:EN-GB">Twitter</span></a><span style="color:#1F497D;mso-fareast-language:EN-GB"> or visit our
</span><a href="http://www.facebook.com/uniofleicester"><span style="color:blue;mso-fareast-language:EN-GB">Facebook</span></a><span style="color:#1F497D;mso-fareast-language:EN-GB"> page<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>