Coder Social home page Coder Social logo

#!#protected_XXX#!# about min HOT 9 CLOSED

plojewski avatar plojewski commented on August 20, 2024
#!#protected_XXX#!#

from min.

Comments (9)

a-r-m-i-n avatar a-r-m-i-n commented on August 20, 2024

Thanks for reporting, I will check this ASAP

from min.

a-r-m-i-n avatar a-r-m-i-n commented on August 20, 2024

I am sorry, but I'm unable to reconstruct this issue. Tested in TYPO3 11 with PHP 8 and TYPO3 10 with PHP 7.4.
Also with invalid regular expressions, I don't get your result.

Can you give me more info and dump your plugin.tx_min config?

from min.

plojewski avatar plojewski commented on August 20, 2024

@a-r-m-i-n Thanks for checking. I've tested on Typo3 10.4.16 / PHP 7.4 and additional config like this:

plugin.tx_min.tinysource {
    head {
        protectCode {
            10 = /(<script.*?>.*?<\/script>)/is
        }
    }
    body {
        protectCode {
            10 = /(<script.*?>.*?<\/script>)/is
        }
    }
}

from min.

neonic avatar neonic commented on August 20, 2024

Hello,

we do have the same behavior. Textareas will be replaced with #!#protected_XXX#!#. The XXX is a hash and regenerates with every refresh.

We use the latest T3 10 LTS with PHP 7.4 and the following configuration:

plugin.tx_min.tinysource {
    enable = 1
    head {
        stripTabs = 1
        stripNewLines = 1
        stripDoubleSpaces = 1
        stripTwoLinesToOne = 1
        stripSpacesBetweenTags = 0
    }
    body {
        stripComments = 1
        stripTabs = 1
        stripNewLines = 1
        stripDoubleSpaces = 1
        stripSpacesBetweenTags = 0
        stripTwoLinesToOne = 0
        preventStripOfSearchComment = 1
        protectCode {
            10 = /(<textarea.*?>.*?<\/textarea>)/is
            20 = /(<pre.*?>.*?<\/pre>)/is
        }
    }
    oneLineMode = 1
}
config {
	compressCss = 1
	concatenateCss = 1
	compressJs = 1
	concatenateJs = 1
}

The static template of min 2.0.0 is not included.

from min.

a-r-m-i-n avatar a-r-m-i-n commented on August 20, 2024

Okay thanks. Locally I'm still not able to reconstruct this issue, but on my own website's dev environment, I was able to reconstruct.

I'm going to fix it as soon as possible.

from min.

a-r-m-i-n avatar a-r-m-i-n commented on August 20, 2024

Okay, I see the problem.
I've moved the "protectCode" to the root level of tinysource configuration. In your code, it is still located within head and body.

This was a major upgrade, which breaks old configurations, which is also well documented:
https://docs.typo3.org/p/t3/min/2.0/en-us/Configuration.html#html-source-compression

from min.

a-r-m-i-n avatar a-r-m-i-n commented on August 20, 2024

I reopen this issue, because I want to fix this behaviour.
If you provide inconsistent config, this should not be the result.

The reason why this is happening: At the place where the protection applies, the body version of protectCode is defined as fallback, in case the root version is missing.

But when restoring the protected code, this fallback is missing.

I'm going to replace the fallback at all. In worst case, you will get no protected textareas, then.

Also I want to improve documentation, when upgrading from v1.

from min.

plojewski avatar plojewski commented on August 20, 2024

Thank you!

from min.

neonic avatar neonic commented on August 20, 2024

Thank you. With changing the configuration, min works like a charm.

from min.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.