News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Package parser problem

Started by grega, February 21, 2024, 09:37:19 AM

Previous topic - Next topic

grega

When I try to deploy the attached  package in SMF 2.1.4 it recognizes only 3 changes in Subs.php but when I try it in
https://www.smfhacks.com/smf-package-parser.html
it recognizes all 4 required changes.

Kindred

specifically which one is the mod package manager missing?

(side note, this makes ALOT of code edits. Hooks with the minimum (if any) code edits is the preferred method with 2.1.x and forward.)

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

grega


Kindred

hmmm....   first guess is that it might have something to do with the ]] in the middle of that edit...  since ]] also indicates the end of the insert action
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

grega

Interesting though that the smfhacks.com parser has no problem.

grega

Quote from: Kindred on February 21, 2024, 10:12:49 AM(side note, this makes ALOT of code edits. Hooks with the minimum (if any) code edits is the preferred method with 2.1.x and forward.)

I know, my goal was to update the existing 15y old mod to work in 2.1, not to rewrite it.

Steve

Did you try taking out the double end brackets and replacing them with just one (or none) as Kindred suggested?

We really don't give support to third party applications. We just want to make SMF work for you.

Maybe you could attach that last edit so we can see if there is a coding issue as far as SMF is concerned?

@Kindred, is this the right place for this topic?
DO NOT pm me for support!

grega

Quote from: Steve on February 22, 2024, 07:10:49 AMDid you try taking out the double end brackets and replacing them with just one (or none) as Kindred suggested?

The brackets are part of a regex, I can not take them out. I tried to split the regex string like this '.....]'.'].....' with no improvement.

Kindred

I don't think this is a bug, but I'm uncertain. We need a dev-type to look at it.

The bracket thing was a guess on first look.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

The double brackets aren't the problem, at least not directly; the CDATA parse step looks explicitly for ]]> as it should.

What I think your problem is is that this file is actually illegal XML and while this would have been tolerated in 2.0's parser and older versions of PHP, this is less tolerated in newer versions.

Specifically the change you have to Subs.php in that 4th block does some matching on accented letters incorrectly and I'm amazed PHP doesn't outright choke on it (and it won't work properly in 2.1 anyway since 2.1 is hard UTF-8 only now)

But I'm a bit bored, I feel like a challenge that isn't *too* technical, does anyone mind if I sit and rewrite this package to use hooks and have a first pass at being UTF-8 correct?

Kindred

#10
Actually, someone else (@GL700wing) is already doing that. Hooks only and improved processing logic.
We are currently beta testing her package
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

live627

Quote from: grega on February 22, 2024, 02:05:39 AM
Quote from: Kindred on February 21, 2024, 10:12:49 AM(side note, this makes ALOT of code edits. Hooks with the minimum (if any) code edits is the preferred method with 2.1.x and forward.)

I know, my goal was to update the existing 15y old mod to work in 2.1, not to rewrite it.
@GL700Wing has made an update

GL700Wing

Quote from: Arantor on February 22, 2024, 02:12:57 PMBut I'm a bit bored, I feel like a challenge that isn't *too* technical, does anyone mind if I sit and rewrite this package to use hooks and have a first pass at being UTF-8 correct?
PM sent.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

grega

Quote from: Arantor on February 22, 2024, 02:12:57 PM(and it won't work properly in 2.1 anyway since 2.1 is hard UTF-8 only now)

It seems to work when I deploy it manually.

Quote from: Arantor on February 22, 2024, 02:12:57 PMBut I'm a bit bored, I feel like a challenge that isn't *too* technical,

How about this for a challenge?: https://www.simplemachines.org/community/index.php?topic=553149.0

Arantor

I said I wanted something not too technical, mostly as a break from the complexity of my day job (which involves doing all sorts of awful things with lots of decimal places that must be perfectly preserved in PHP, so none of the maths is done using the usual operators, and then write that into massive Excel spreadsheets, after payment has happened, average Stripe transaction is £25,000. And it's just me writing this platform.)

In any case, MediaWiki plugins are so much worse to write than SMF (or even WordPress) plugins. I try to avoid MW, at this point I'd rather build my own wiki from scratch than write more plugins for it.

@GL700Wing I will take a look tonight if I have any brain cells left.

live627

Quote from: Arantor on February 23, 2024, 04:50:21 AMI said I wanted something not too technical, mostly as a break from the complexity of my day job (which involves doing all sorts of awful things with lots of decimal places that must be perfectly preserved in PHP, so none of the maths is done using the usual operators
that hurt to read :(

Advertisement: