cfpdf destination attribute with empty string throw incorrect error

Description

In cfpdf, using an empty string or space in the destination attribute throws an incorrect error like C:\lucee-express-5.3.10.10-SNAPSHOT\wbeapps\ROOT (Access is denied). Seems ACF throws an error like The attribute destination specified in the CFPDF tag is either empty or invalid. Lucee should throw an error like Attribute [destination] has an invalid value [].

<cfdocument format="pdf" filename="#expandPath("./")#test.pdf" overwrite="true"> test pdf </cfdocument> <cfpdf action="addheader" source="#expandPath("./")#test.pdf" destination="" overwrite=true text="test header">


Stacktrace

lucee.runtime.exp.NativeException: C:\lucee-express-5.3.10.10-SNAPSHOT\webapps\ROOT (Access is denied) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(Unknown Source) at java.io.FileOutputStream.<init>(Unknown Source) at lucee.commons.io.res.type.file.FileResource.getOutputStream(FileResource.java:264) at lucee.commons.io.res.type.file.FileResource.getOutputStream(FileResource.java:254) at lucee.commons.io.IOUtil.copy(IOUtil.java:171) at lucee.runtime.op.IOImpl.copy(IOImpl.java:145) at org.lucee.extension.pdf.tag.PDF.doActionAddHeaderFooter(PDF.java:823) at org.lucee.extension.pdf.tag.PDF.doEndTag(PDF.java:682) at test_cfm$cf.call(/test.cfm:9) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1043) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:935)

Environment

None

Activity

Show:

Pothys - MitrahSoft 13 June 2022 at 08:32

I added a testcase and fix to this ticket
Pull Request:https://github.com/lucee/extension-pdf/pull/43

Fixed

Details

Assignee

Reporter

Priority

Labels

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 9 June 2022 at 14:13
Updated 20 June 2022 at 10:47
Resolved 20 June 2022 at 10:47

Flag notifications