Giter Club home page Giter Club logo

de-de's Issues

Funktioniert nicht bei Upload per Drag & Drop in Gutenberg bzw. über REST API

Fügt man ein Bild per Drag & Drop in Gutenberg ein (nicht über das Media Model, sondern direkt in den Content), wird das Bild im Body per POST-Request an den REST API Endpoint /wp/v2/media gesendet.

Aktuell fügt deswegen dieses Plugin keinen Filter zu sanitize_file_name hinzu. Über die REST_REQUEST-Konstante, könnte man checken ob es sich um einen REST Request handelt. Allerdings wird die Konstate aktuell recht spät von WordPress initalisiert. Hier müsste man das Plugin erst bei rest_api_init ausführen, damit REST_REQUEST = true ist.

Außerdem gibt es ein weiteres Problem. Da der Upload im Body des Request erfolgt, wird der Filename aus dem Content-Disposition Header entnommen: https://github.com/WordPress/wordpress-develop/blob/4848b1e3aa956766d276d8f192ec398c01d6ace5/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php#L742

Deswegen wird der Title auch ohne Umlaute gespeichert.

Meine Idee wäre das Plugin zumindest bei init und rest_api_init zu laden weil aktuell wird aus allen Uploads die man per Drag & Drop in Gutenberg macht, keine Umlaute entfernt.

[Bug]: PHP8.3 Deprecated: Function utf8_decode()

Description of the bug

Last plugin customization was a long time ago and if you switch to PHP8.3, you get an error message.

The upload and the naming seems to work, I uploaded length.jpg and it was renamed to length.jpg.

In some cases, the WordPress backend did not load when PHP8.3 and the current plugin version were running.

Reproduction instructions

Update to PHP8.3

Expected behavior

Nothing special expected

Environment info

WordPress-Version: 6.4.2
PHP-Version: 8.3.1
MySQL/MariaDB-Version: 5.7.42

Aktive Plugins:
Borlabs Cookie (3.0.0.13)
Broken Link Checker (2.2.4)
Honeypot for Contact Form 7 (2.1.1)
Contact Form 7 (5.8.6)
Credit Tracker (1.1.17)
Exclude Image Thumbnails From UpdraftPlus Backups (1.0.3)
Download Monitor (4.9.5)
Mehrere Dateien per Drag & Drop hochladen - Kontaktformular 7 (1.3.7.5)
Yoast Duplicate Post (4.5)
Envira Gallery (1.9.9.2)
FileBird Pro (6.0.4)
Avada Builder (3.11.3)
Avada Core (5.11.3)
Indeed My Team (3.0)
InfiniteWP - Client (1.12.5)
NinjaFirewall (WP Edition) (4.5.10)
NinjaScanner (3.1)
Redirector (3.0.1)
Slider Revolution (6.6.20)
UpdraftPlus – Sichern/Wiederherstellen (2.23.14.26)
Yoast SEO (21.8)
WP Mail Logging (1.12.0)
WP Mail SMTP (3.11.0)

Aktives Theme: Avada Child (Avada 7.11.3)

Relevant log output

Deprecated: Function utf8_decode() is deprecated in .../plugins/de_de/de_DE.php on line 332

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Permalink issues with de_DE 1.0.1

Description of the bug

When testing version 1.0.1 in various systems, I noticed that there seems to be a bug with the permalinks. I created a post with umlauts and got problems with umlauts. When I deactivated the plugin, the error was no longer present.

With the test file "The ugly duckling costs 1 €.jpg" the result looks like this: File name: "das-haessliche-entlein-kostet-1-e-scaled.jpg".

A post/page with the name "Das hässliche Entlein kostet 1 €.jpg" becomes "das-ha¤aliche-e...ein-kostet-1-eur".

Error can be reproduced 1:1 in various similar system setups.

Reproduction instructions

  1. Update de_DE to 1.0.1
  2. Generate File, Post or Page with Title "Das häßliche Entlein kostet 1 €.jpg"

Expected behavior

I did not expect any intervention in the permalink structure of posts and pages. File names seem to work at first glance.

Environment info

PHP 8.2 + 8.3
Avada 7.11.9
WordPress 6.5.4

Relevant log output

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Filter für typographische Sonderzeichen - wptexturize()

neue Filter in WP 3.4 für wptexturize()
http://core.trac.wordpress.org/browser/trunk/wp-includes/formatting.php#L29

// Transform into regexp sub-expression used in _wptexturize_pushpop_element
// Must do this everytime in case plugins use these filters in a context sensitive manner
no_texturize_tags
no_texturize_shortcodes

Bsp. Anführungszeichen:
„ --> Win: Alt + 0132
“ --> Win: alt + 0147
siehe http://www.typografie.info/2/wiki.php?title=Anfuehrungszeichen

weitere Besonderheiten prüfen: http://www.typografie.info/2/wiki.php?title=Kategorie:Typografie

Hilfe für Web, sollte als Auswahl reichen:
http://webdesign.crissov.de/Typografie/Zitieren
:lang(de-de)>q {quotes: "„" "“" "‚" "‘"}

Bindestrich
http://webdesign.crissov.de/Typografie/Striche#U002D

Auslassungspunkte
…
Kurz gesagt, steht der Punkt nie, andere Satzzeichen schon, und ein Leerzeichen immer, es sei denn die Punkte ersetzen Buchstaben des vorhergehenden Wortes: F… dich selber, du …! Sonst …

Add license comment

/**

  • LICENSE:
  • Copyright YEAR, NAME OF AUTHOR (opt.: Mail-adress of author)
  • This program is free software; you can redistribute it and/or
  • modify it under the terms of the GNU General Public License
  • as published by the Free Software Foundation; either version 2
  • of the License, or (at your option) any later version.
  • This program is distributed in the hope that it will be useful,
  • but WITHOUT ANY WARRANTY; without even the implied warranty of
  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • GNU General Public License for more details.
  • You should have received a copy of the GNU General Public License
  • along with this program; if not, write to the Free Software
  • Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    */

de_DE.php mit WordPress 3.1 bzw. 3.1.1

Hallo Frank,

ich verwende die Datei de_DE.php bereits seit einigen WordPress-Versionen erfolgreich. Vielen Dank an Heiko Rabe und an dich für diese pfiffige Lösung! Nach dem Update von WordPress 3.05 auf WordPress 3.1 funktionierte die Umwandlung der Umlaute allerdings erst wieder nach Aktualisierung von de_DE.php auf Version 0.7.1.

Was nach der Aktualisierung noch nicht wieder funktionierte, war die Umwandlung von Zeichen mit Accents (z. B. è und é). Wunschvorstellung war das Weglassen des Accent-Strichs, tatsächlich verschwand jedoch das komplette Zeichen.

Mein Test-String (im Titel eines Artikels) resultierte in folgender Titelform:
DE äöüß ÄÖÜ DE FRANZ èé FRANZ >>> de-aeoeuess-aeoeue-de-franz-franz

Ursache dieses Verhaltens ist eine (versehentliche?) Änderung des Quellcodes der WordPress-Funktion "sanitize_title_with_dashes" zwischen der Version 3.05 und 3.1 (diese Funktion wird in de_DE.php in Zeile 43 aufgerufen): In Version 3.05 findet sich in Zeile 823 der Datei "wp-includes/formatting.php" die Anweisung "$title = remove_accents($title);". In den Versionen 3.1 und 3.1.1 ist diese Anweisung verschwunden, siehe hierzu: http://core.trac.wordpress.org/changeset/15929

Die korrekte Behandlung von Accents kann wiederhergestellt werden, in dem der Aufruf von "remove_accents" in der Datei de_DE.php unmittelbar vor dem Aufruf von "sanitize_title_with_dashes" ergänzt wird. Der komplette Abschnitt sieht damit wie folgt aus:

    $title = str_replace( $umlaut_chars['ecto'], $umlaut_chars['perma'], $title );
    $title = str_replace( $umlaut_chars['in'], $umlaut_chars['perma'], $title );
    $title = str_replace( $umlaut_chars['html'], $umlaut_chars['perma'], $title );
    /*NEU */    $title = remove_accents($title); /* NEU */
    $title = sanitize_title_with_dashes( $title );
    $title = str_replace( '.', '-', $title );

Damit erhält man das gewünschte Ergebnis: de-aeoeuess-aeoeue-de-franz-ee-franz

Viele Grüße,
upscho

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.