From nobody Sat Mar 5 23:29:46 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8072A1A00345 for ; Sat, 5 Mar 2022 23:29:58 +0000 (UTC) (envelope-from lobo@bsd.com.br) Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KB1Cn27hBz4rVM for ; Sat, 5 Mar 2022 23:29:57 +0000 (UTC) (envelope-from lobo@bsd.com.br) Received: by mail-ot1-x334.google.com with SMTP id w17-20020a056830111100b005b22c584b93so155587otq.11 for ; Sat, 05 Mar 2022 15:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mS1fqaXcCrJn26ZfSWY83gfINomwx/0jPIpfPXOnYYc=; b=G2WucDYpaa+hK9lgl8hlVs0dnQkRBYpXFgq+mv9GDUQngWrKC+jJiTBLlB1EUzlMiU KyjICNSi9w/09JkFTE0dDhfi4fUBcmH0Mt0wgQUdrmgRx7Okkmdy58G/JU0zQ4+ytbs+ +gcgF6tSUtJCRNyk47pJjPFgcIvXluowMXXZk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mS1fqaXcCrJn26ZfSWY83gfINomwx/0jPIpfPXOnYYc=; b=zqQpblbQR67uMNxtV6t3YKf9bunjx1jQoMfjljdzyZa6EuiFET9A2vQ0z3lhQ04ILs +IK+k3sK7+p4axeVHrm2I8z66RjyuaDNQ9Cwgst2WYLjKCEXpyu3Up9a2XEZDeQJbmLm nhN5kWUg8+FzkPoqdPKhGe96osEHrAbK3Xwrujz2s9hu/IA3d4FsZ6XJKiNIHItCh5eW pioEOyOkkoPYxls+BpS3VjXs6vy4prHonvocquBIllIMK25YFSZu6TJOnxBtqaG4DJwD mbGYLAb/rz+07bBd0xYSJoIh+kBPHI+kzziQUyjG3i7a7t0m502Wo0gCOCKW/l39QICS hmGg== X-Gm-Message-State: AOAM532OILtiG7boVBwe78bJyEYWNq6oKMXE/EOT1gDfk+tRubnEpyau 2uAi2bRvPRCJmJt5Rc1qPqjMmMjYIhPw4FdTKIAOpLX5cGo= X-Google-Smtp-Source: ABdhPJyk+Z34BxKZtAP2mOYADBYNgHGMLI1FaytSgrPnBHvrNBKNx+DZDx4FyCfsVWNEqbudAxt0694jqYFQ8djg25Q= X-Received: by 2002:a05:6830:1e36:b0:5af:1452:b08d with SMTP id t22-20020a0568301e3600b005af1452b08dmr2421894otr.339.1646522996401; Sat, 05 Mar 2022 15:29:56 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: <599882921.762148.1646517960127.JavaMail.zimbra@shaw.ca> In-Reply-To: <599882921.762148.1646517960127.JavaMail.zimbra@shaw.ca> From: Mario Lobo Date: Sat, 5 Mar 2022 20:29:46 -0300 Message-ID: Subject: Re: file upload issues with SuiteCRM V7/8 (or apache24 and php8 diff FreeBSD vs Debian) To: Dale Scott Cc: freebsd-questions Content-Type: multipart/alternative; boundary="00000000000050bdc905d981024c" X-Rspamd-Queue-Id: 4KB1Cn27hBz4rVM X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsd.com.br header.s=capeta header.b=G2WucDYp; dmarc=none; spf=pass (mx1.freebsd.org: domain of lobo@bsd.com.br designates 2607:f8b0:4864:20::334 as permitted sender) smtp.mailfrom=lobo@bsd.com.br X-Spamd-Result: default: False [-3.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[bsd.com.br:s=capeta]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; DMARC_NA(0.00)[bsd.com.br]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsd.com.br:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::334:from]; NEURAL_HAM_SHORT(-0.90)[-0.900]; MLMMJ_DEST(0.00)[freebsd-questions]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --00000000000050bdc905d981024c Content-Type: text/plain; charset="UTF-8" Got it, thanks man! On Sat, Mar 5, 2022, 19:06 Dale Scott wrote: > *From: *"Mario Lobo" > *To: *"Dale Scott (dalescott@shaw)" > *Cc: *"freebsd-questions" > *Sent: *Saturday, March 5, 2022 12:40:16 PM > *Subject: *Re: file upload issues with SuiteCRM V7/8 (or apache24 and > php8 diff FreeBSD vs Debian) > > > > On Sat, Mar 5, 2022, 01:33 Dale Scott wrote: > >> On Mar 1, 2022 6:21 PM, Waitman Gobble wrote: >> >> OK. The latest release they have on their site is 8.x something but >> there's no mention of it on their git repository, I wonder if they >> haven't yet released 8.x for PHP 8 to "community". >> >> >> Good news. The error had nothing to do with FreeBSD and I had a patch the >> next day. It was nice to see the community response. Thanks again for your >> help Waitman. Cheers, Dale >> > > Hi Dale. > > Could you please post the patch, or a link to it? > > > Sure. Sorry for my oversight. > > The patch replaces line 267 in download.php and line 269 > modules/Documents/Document.php, in both SuiteCRM-7.12.4 and . In > SuiteCRM-8.0.3 (in SuiteCRM-8.0.3 the files are identical but have been > moved to .../legacy/.... directory). > > E.g. in download.php, replace: > > if (in_array($row['file_ext'], $sugar_config['allowed_preview'], true)) { > > with: > > if (isset($row['file_ext'], $sugar_config['allowed_preview']) && > in_array($row['file_ext'], $sugar_config['allowed_preview'], true)) { > > > Link to topic in the SuiteCRM forum with reply from project maintainer > Matt with patch: > https://community.suitecrm.com/t/php-fatal-error-after-file-upload-on-v7-and-v8-solved/84177 > > Link to issue reported to SuiteCRM GitHub repo: > https://github.com/salesagility/SuiteCRM/issues/9530 > > Cheers, > Dale > > --00000000000050bdc905d981024c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Got it, thanks man!

<= div dir=3D"ltr" class=3D"gmail_attr">On Sat, Mar 5, 2022, 19:06 Dale Scott = <dalescott@shaw.ca> wrote:


Sure. Sorry for my oversight.<= /div>

The patch replaces=C2=A0line 267 in download.php and line 269 modul= es/Documents/Document.php,=C2=A0in both SuiteCRM-7.12.4 and . In SuiteCRM-8= .0.3 (in SuiteCRM-8.0.3 the files are identical but have been moved to .../= legacy/.... directory).

E.g. in download.php, replace:

if (in_arra= y($row['file_ext'], $sugar_config['allowed_preview'], true)= ) {

with:

if (iss= et($row['file_ext'], $sugar_config['allowed_preview']) &= ;& in_array($row['file_ext'], $sugar_config['allowed_previe= w'], true)) {



Link to issue reported to= SuiteCRM GitHub repo:=C2=A0https://github.com/s= alesagility/SuiteCRM/issues/9530

Cheers,
Dale

--00000000000050bdc905d981024c--