<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Liam, thank you for documenting this. A customer just reported an
odd failure to me me, and I traced it down to this incorrect
handling of maximum subject-length.</p>
<p>In our case, (6.13-3) we were not seeing the 500 failure, but
were falling through to the friendlier (less informative) 'Request
Error'</p>
<p>I've just examined the published source for 6.15-6 and see only
one difference in lib/Req.php (at line 269), so this maximum
subject-length behavior is unchanged.<br>
</p>
<pre class="moz-signature" cols="72">--
Do things because you should, not just because you can.
John Thurston 907-465-8591
<a class="moz-txt-link-abbreviated" href="mailto:John.Thurston@alaska.gov">John.Thurston@alaska.gov</a>
Department of Administration
State of Alaska</pre>
<div class="moz-cite-prefix">On 5/23/2024 6:12 AM, Gretton, Liam via
ZendTo wrote:<br>
</div>
<blockquote type="cite" cite="mid:WM!3381493203083145ce311df99ee43c5a7ffc1c80d070d095b8282b05354cef74472d99956e5504aeabb6d29bf21739ea!@mx.jul.es">
<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-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;}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;}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]-->
<div>
<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('<a class="moz-txt-link-abbreviated" href="mailto:me@example.com">me@example.com</a>')<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), '<a class="moz-txt-link-abbreviated" href="mailto:me@example.com">me@example.com</a>')<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>
</div>
</div>
<span style="white-space: pre-wrap">_______________________________________________</span>
<pre class="moz-quote-pre" wrap="">ZendTo mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ZendTo@zend.to">ZendTo@zend.to</a>
<a class="moz-txt-link-freetext" href="http://jul.es/mailman/listinfo/zendto">http://jul.es/mailman/listinfo/zendto</a>
</pre>
</blockquote>
</body>
</html>