Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

True\Punycode auf Version 2 heben #748

Closed
BugBuster1701 opened this issue Mar 31, 2017 · 7 comments
Closed

True\Punycode auf Version 2 heben #748

BugBuster1701 opened this issue Mar 31, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@BugBuster1701
Copy link
Contributor

BugBuster1701 commented Mar 31, 2017

Aus der Changelog:

    [Enhancement] PHP 7 support
    [Fix] Renamed True namespace to TrueBV as it is a reserved word in PHP 7

Achtung, der Namespace ändert sich, daher müsste hier dieser angepasst werden:
https://github.com/contao/core-bundle/blob/master/src/Resources/contao/library/Contao/Idna.php#L13

in
use TrueBV\Punycode;

in composer.json dann
true/punycode:~2.0

Ein weiterer Grund ist, dass eine Erweiterung von mir eine Lib nutzt, die von Punycode die 2.x benötigt, in Contao 4 führt das dann zum Konflikt.

Nachtrag: Der PHP 7 Grund ist wohl nicht eindeutig, aber die Aktualisierung wäre trotzdem wünschenswert. Es gibt auch weitere Bugfixe wie "Cannot decode domain in uppercase"

@BugBuster1701 BugBuster1701 changed the title True\Punycode auf Version 2 heben wegen PHP7 True\Punycode auf Version 2 heben Apr 5, 2017
@leofeyer leofeyer added the bug label Apr 5, 2017
@leofeyer leofeyer added this to the 4.3.8 milestone Apr 5, 2017
@BugBuster1701
Copy link
Contributor Author

Achtung:
Punycode prüft neuerdings in der decode Methode ob die Parts des Parameters "between 1 and 63 octets," ist, wenn nein folgt eine Exception. siehe Punycode.php#L176-L199
Dadurch lässt sich System->Einstellungen nicht mehr aufrufen. (mit Punycode 2.x)
(Datei-URL wird mit leerem Parameter (default) versucht zu decodieren)

Ich musste daher folgendes anpassen in Idna::decode

        public static function decode($strDomain)
        {
                $objPunycode = new Punycode;

                return $objPunycode->decode($strDomain);
        }

wird zu

        public static function decode($strDomain)
        {
                if ($strDomain == '')
                {
                        return '';
                }

                $objPunycode = new Punycode;

                return $objPunycode->decode($strDomain);
        }

bei Punycode->encode() wird das auch geprüft.

@leofeyer
Copy link
Member

Aktualisiert in 1c6a5e7.

@BugBuster1701
Copy link
Contributor Author

Reopen oder neu anlegen? Du hast ja dankenswerterweise vor in die 4.4 wieder Punycode 2 zu integrieren.

@leofeyer leofeyer added feature and removed bug labels Apr 27, 2017
@leofeyer leofeyer modified the milestones: 4.4.0, 4.3.8 Apr 27, 2017
@leofeyer leofeyer reopened this Apr 27, 2017
@ghost
Copy link

ghost commented Apr 27, 2017

As discussed in the forum (https://community.contao.org/de/showthread.php?66532-Elementtyp-Youtube-fehlerhaft) it might be a good idea not to use "rgxp" => "url" for youtube ids.

Suggestions from this forum thread for new eval options:

  • "rgxp" => "youtubeid"
  • "rgxp" => "realalnum" which is /^[[:alnum:]]*$/
  • "rgxp" => "regex([a-zA-Z0-9]*)" (the part in brackets is a regex which can be set individually)
  • no validation, instead just "urlencode" => true

@leofeyer
Copy link
Member

Implemented in ca7545f.

@BugBuster1701
Copy link
Contributor Author

Da es noch nicht in der Beta1 enthalten ist die Frage, kommt es mit der RC1?

@leofeyer
Copy link
Member

leofeyer added a commit that referenced this issue Oct 28, 2019
Description
-----------

Fixes #748

Commits
-------

2fc9828b Do not make tl_user.admin an excluded field (see #748)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants