Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21549#discussion_r195153892
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/xml/UDFXPathUtilSuite.scala
 ---
    @@ -77,6 +77,23 @@ class UDFXPathUtilSuite extends SparkFunSuite {
         assert(ret == "foo")
       }
     
    +  test("embedFailure") {
    +    import org.apache.commons.io.FileUtils
    +    import java.io.File
    +    val secretValue = String.valueOf(Math.random)
    +    val tempFile = File.createTempFile("verifyembed", ".tmp")
    +    tempFile.deleteOnExit()
    +    val fname = tempFile.getAbsolutePath
    +
    +    FileUtils.writeStringToFile(tempFile, secretValue)
    +
    +    val xml =
    +      "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<!DOCTYPE test [ 
\n" +
    +      "    <!ENTITY embed SYSTEM \"" + fname + "\"> \n" + "]>\n" + 
"<foo>&embed;</foo>"
    --- End diff --
    
    xml has a unique syntax. A little bit hard to make it work sometimes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to