967287790fefdc91606ec7b45566a41648353563,app/grandchallenge/core/templatetags/grandchallenge_tags.py,InsertFileNode,render,#InsertFileNode#Any#,395

Before Change


            return self.make_error_msg(f"Path Resolution failed: {e}")

        challenge_short_name = context["site"].short_name
        filepath = os.path.join(
            settings.MEDIA_ROOT, challenge_short_name, filename
        )
        filepath = os.path.abspath(filepath)
        filepath = self.make_canonical_path(filepath)
        // when all rendering is done, check if the final path is still not getting
        // into places it should not go.
        if not self.is_inside_project_data_folder(filepath, context["site"]):
            error_msg = ""{}" cannot be opened because it is outside the current project.".format(
                filepath
            )
            return self.make_error_msg(error_msg)

        storage = DefaultStorage()

        try:
            with storage.open(filepath, "r") as f:

After Change



        challenge = context["site"]

        try:
            filepath = safe_join(challenge.get_project_data_folder(), filename)
        except SuspiciousFileOperation:
            return self.make_error_msg(
                f""{filename}" cannot be opened because it is outside the current challenge."
            )

        storage = DefaultStorage()

        try:
            with storage.open(filepath, "r") as f:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: comic/grand-challenge.org
Commit Name: 967287790fefdc91606ec7b45566a41648353563
Time: 2019-01-02
Author: jamesmeakin@gmail.com
File Name: app/grandchallenge/core/templatetags/grandchallenge_tags.py
Class Name: InsertFileNode
Method Name: render


Project Name: comic/grand-challenge.org
Commit Name: 967287790fefdc91606ec7b45566a41648353563
Time: 2019-01-02
Author: jamesmeakin@gmail.com
File Name: app/grandchallenge/core/templatetags/grandchallenge_tags.py
Class Name: InsertFileNode
Method Name: render


Project Name: pytorch/tutorials
Commit Name: 00e131977b4e2cbe134f8832f3fbac7940644586
Time: 2018-08-29
Author: minkawhich@fb.com
File Name: beginner_source/hybrid_frontend/introduction_to_hybrid_frontend_tutorial.py
Class Name:
Method Name:


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 35533cd60dc37b63681ac63d92d0c60bb38dde48
Time: 2014-12-02
Author: connormccoy@google.com
File Name: perfkitbenchmarker/benchmarks/speccpu2006_benchmark.py
Class Name:
Method Name: Prepare