Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2023-02-20 21:10:42

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

Re: exclude article

lindabb wrote #334690:

Thank you Pat64,
but I couldn’t use etc’s code . I got error
strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated while parsing form None on page xx

Intriguing. Not reproducible on the demo site (link valid for 3 hours).

Offline

#14 2024-01-18 15:51:48

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: exclude article

@Devs:

for your interest, I noticed the attribute escape="tags" produces (from the regex) an invalid character if the final sign is accentuated (e.g. î ).


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#15 2024-01-18 18:52:33

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

Re: exclude article

Pat64 wrote #336407:

I noticed the attribute escape="tags" produces (from the regex) an invalid character if the final sign is accentuated (e.g. î ).

Sorry, Patrick, not sure to understand: escape="tags" calls php strip_tags() function, there is no regex involved. Mind providing more details?

Offline

#16 2024-01-19 07:00:46

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: exclude article

Well.
A few days ago, working on a new project, I encounter a strange behavior.

Based on this sentence: “Dans un véritable récit de voyage, le scientifique retrace son parcours de chercheur et nous entraîne dans une étonnante enquête archéologique.” and your code:

<txp:hide process="1" trim="/^\s*(.{95}\w*)\b.+$/s" replace='$1… <a href="<txp:permlink />">Lire la suite</a>'>
	<txp:body />
</txp:hide>

The result produced this:

Dans un véritable récit de voyage, le scientifique retrace son parcours de chercheur et nous entra… Lire la suite

The final î character is changed by a not well encoding sign (can’t include it here because Textile rejects the sign: a question mark).

Note: I’m using TXP 4.9-dev for devs demand testing by users on a local server (MAMP for PCs, PHP version: 8.0.1, MySQL: 5.7.24). Sometimes when I change the length of the REGEX (words count below {104}), the entire page crashes (nothing is rendering)…


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#17 2024-01-19 08:48:05

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

Re: exclude article

Ah, ok, this pattern. It’s not a bug, you need to add u modifier to regex for Unicode:

<txp:hide process="1" trim="/^\s*(.{95}\w*)\b.+$/us" replace='$1… <a href="<txp:permlink />">Lire la suite</a>'>
	<txp:body />
</txp:hide>

Offline

#18 2024-01-19 09:48:00

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: exclude article

Perfect, Oleg. You are a programming master!


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#19 2024-01-19 10:05:06

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

Re: exclude article

Certainly not. It’s a lowercase u, sorry.

More useful info here.

Offline

Board footer

Powered by FluxBB