[3.3][RC] Autolinks 1.3.9

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
pierredu
Registered User
Posts: 1268
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.3][RC] Autolinks 1.3.3

Post by pierredu »

It is also upgraded.
Thanks again.
Holger
Registered User
Posts: 1884
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: [3.3][RC] Autolinks 1.3.3

Post by Holger »

Thank YOU! :D
User avatar
serek
Registered User
Posts: 80
Joined: Fri Jan 30, 2015 12:47 pm
Location: London
Name: Serge Victor

Re: [3.3][RC] Autolinks 1.3.3

Post by serek »

Hi Pierre, it seems that your amazing extension is not PHP8 ready yet:

PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in ../lmdi/autolinks/event/listener.php on line 236"
--
find me somewhere in SW London, 100 meters from Thames River
User avatar
pierredu
Registered User
Posts: 1268
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.3][RC] Autolinks 1.3.5

Post by pierredu »

Thanks for the pointer. An updated version was loaded on github.
ABDev
Registered User
Posts: 909
Joined: Sun Aug 21, 2005 9:29 pm
Location: France
Name: Adrien Bonnel

Re: [3.3][RC] Autolinks 1.3.5

Post by ABDev »

There are many parts of code which can be optimized again.
I will give you the fixes in the week.
manarak
Registered User
Posts: 116
Joined: Sun Nov 21, 2010 1:01 pm

Re: [3.3][RC] Autolinks 1.3.5

Post by manarak »

Hello and thanks for the great module !

I have some questions:
- is it possible to modify existing links that use the [URL] bbcode ?
- is it possible to use wildcards, for example to recognize existing links in the form https://domain.com/xyz and to add ?argument=1234, or if there already is a ? in the url to add &argument=1234 instead ?
- maybe also useful for some: strip existing links of path elements or of existing arguments, replace them with another?
User avatar
pierredu
Registered User
Posts: 1268
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.3][RC] Autolinks 1.3.5

Post by pierredu »

It would be a major revision.
I don't have enough time for this.
manarak
Registered User
Posts: 116
Joined: Sun Nov 21, 2010 1:01 pm

Re: [3.3][RC] Autolinks 1.3.5

Post by manarak »

pierredu wrote: Wed Aug 31, 2022 6:02 am It would be a major revision.
I don't have enough time for this.
ok, merci quand même :)
User avatar
wads24
Registered User
Posts: 679
Joined: Fri Jun 10, 2005 4:44 am
Name: James

Re: [3.3][RC] Autolinks 1.3.5

Post by wads24 »

When I was testing permissions for the anonymous user because I was getting some brute force attacks on that username. I noticed that this user is able to access admin and change the settings for the extension.
Is there a fix for this?


FYI
This user does not have any administration permissions or for the guests group or the anonymous user.
Thanks in advance for a reply.
User avatar
pierredu
Registered User
Posts: 1268
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.3][RC] Autolinks 1.3.5

Post by pierredu »

I'll try to look at this as soon as possible.
User avatar
pierredu
Registered User
Posts: 1268
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.3][RC] Autolinks 1.3.5

Post by pierredu »

Can you give me more explanations? I don't see how a guest could access the admin control panel.
User avatar
wads24
Registered User
Posts: 679
Joined: Fri Jun 10, 2005 4:44 am
Name: James

Re: [3.3][RC] Autolinks 1.3.5

Post by wads24 »

pierredu wrote: Fri Jan 06, 2023 10:26 am Can you give me more explanations? I don't see how a guest could access the admin control panel.
That's what I thought also... Although I was using test user permissions logged in as admin.
The admin link shows on the board and should only show disclosure stating
You currently have the permissions from Anonymous. You are able to browse the board with this user’s permissions, but not access the administration control panel since admin permissions were not transferred. You can revert to your permission set at any time.

But I could see the extension settings.
Screenshot_20230109_200747_Chrome.png
You do not have the required permissions to view the files attached to this post.
Thanks in advance for a reply.
User avatar
pierredu
Registered User
Posts: 1268
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.3][RC] Autolinks 1.3.5

Post by pierredu »

When testing the Anonymous user, I get the message above and when I click on the ACP, I get it a second time, but I don't access the extension configuration screen.
I think this must be something special on your board.
PoFi
Registered User
Posts: 7
Joined: Sun Feb 10, 2008 1:07 pm

Re: [3.3][RC] Autolinks 1.3.5

Post by PoFi »

A nice and useful extension, I think.
I looked around in the listener.php and tried to make a few adjustments. Unfortunately without success...

Is there a way to make the replacement in the forum posts case sensitive?

Currently this is all done with preg_replace. I tried to do that with strcmp. However, I don't know exactly which strings actually need to be compared here.
Tried that with $parts and $terms.

Code: Select all

if (!($part[0] == '<' && $parts[$index + 1][0] == '>') &&
                !($part[0] == '[' && $parts[$index + 1][0] == ']') &&
                empty($img) && empty($code) && empty($alink) && empty($ulink) && empty($script)) {
                if ($this->config['lmdi_autolinks'] == 2) {
                    //    $part = preg_replace($terms, $furls, $part);
                    $nbt = count($terms);
                    for ($i = 0; $i < $nbt; $i++) {
                        if (strcmp($fterms[$i], $part) === 0) {
                            $part = str_replace($furls[$i], $urls[$i] . $fterms[$i], $part);
                        }
                        //    $part = str_replace($furls[$i], $urls[$i] . $fterms[$i], $part); 
                    }
                } else {
                    $part = preg_replace($terms, $urls, $part);
                }
                $parts[$index] = $part;
            }
User avatar
pierredu
Registered User
Posts: 1268
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.3][RC] Autolinks 1.3.5

Post by pierredu »

The array $terms is the list of the terms to be replaced by the URLs.
The array $parts is the segmented post text.

Return to “Extensions in Development”