[Docebo] Docebo con PHP 5.3.29 (soluzione)

Installazione, configurazione generale, notifiche, API, lingue, problemi server
Post Reply
User avatar
renato.gambella
FormaLms User
Posts: 73
Joined: Tue Mar 12, 2013 8:49 am

[Docebo] Docebo con PHP 5.3.29 (soluzione)

Post by renato.gambella »

Posto perché potrebbe essere utile a qualcuno. E' la soluzione che SERVERPLAN ha adottato su una mia installazione di Docebo dopo un aggiornamento del PHP in seguito al quale veniva visualizzato l'errore "Disallowed key characters in global data.":

Il problema è nel CMS docebo con la versione di PHP 5.3.29. Il fix si trova in questa pagina: http://stackoverflow.com/questions/2476 ... -offset-20

Praticamente nel file

lib/lib.filterinput.php

c'è da sostituire la riga seguente:
if ( ! preg_match('#^[&a-zA-Z0-9\.:_/-\s]+$#uD', $str)) {

con:
if ( ! preg_match('#^[&a-zA-Z0-9\.:\s-_]+$#uD', $str)) {
User avatar
max
FormaLms Guru
Posts: 2735
Joined: Thu Mar 01, 2012 10:41 am
Version: forma.lms 2.4
Contact:

Re: [Docebo] Docebo con PHP 5.3.29 (soluzione)

Post by max »

Ciao Renato,
grazie di aver condiviso la cosa.
Già se n'era parlato anche qui viewtopic.php?f=5&t=12037&p=15282
Bene cmq che ci sia anche il tuo thread che richiama la versione di php, così magari qualcuno lo può trovare anche cercando con quella chiave di ricerca.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
User avatar
canelli
FormaLms Guru
Posts: 496
Joined: Thu Nov 08, 2012 12:21 pm
Version: forma.lms 2.0
Contact:

Re: [Docebo] Docebo con PHP 5.3.29 (soluzione)

Post by canelli »

Attenzione.
come riportato anche nel post Disallowed key characters in global data.
la riga corretta da inserire è

Code: Select all

    if ( ! preg_match('#^[&a-zA-Z0-9\.\/:_\s-]+$#uD', $str)) {
Quella indicata in http://stackoverflow.com/questions/2476 ... -offset-20 e riportata da Renato è potenzialmente ancora errata.

Il problema si può presentare non solo per upgrade del PHP (tutte le versioni sono potenzialmente interessate) ma anche per upgrade del sistema operativo e l'aggiornamento delle librerie PCRE che eseguono il riconoscimento delle espressioni regolari
Cercate nel forum le riposte prima di chiedere. Check the forum before posting
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology

http://www.joint-tech.com
---------------
User avatar
renato.gambella
FormaLms User
Posts: 73
Joined: Tue Mar 12, 2013 8:49 am

Re: [Docebo] Docebo con PHP 5.3.29 (soluzione)

Post by renato.gambella »

Ciao Claudio,
ho provato a modificare il file (lib/lib.filterinput.php ) con la stringa che hai suggerito tu, ma non funziona (viene visualizzato ancora il messaggio"Disallowed key characters in global data.").

La stringa invece suggerita dal supporto di Serverplan risolve il problema.

Lo stesso problema l'ho riscontrato anche nell'installazione ex novo di FormaLms v.1.2.1, funziona solo la stringa suggerita da loro(*).

Inoltre, sempre se si installa FormaLms su un server in hosting da Serverplan, prima dell'installazione nel file .htaccess della root deve esser modificata la direttiva:

Options +FollowSymLinks

sostituendola da

Options +SymLinksIfOwnerMatch

altrimenti restituisce l'errore "500 Internal Server Error".

Renato

(*) ma FormaLms v.1.2.1 non è già predisposta per essere installata su server con PHP 5.4?
User avatar
canelli
FormaLms Guru
Posts: 496
Joined: Thu Nov 08, 2012 12:21 pm
Version: forma.lms 2.0
Contact:

Re: [Docebo] Docebo con PHP 5.3.29 (soluzione)

Post by canelli »

Ciao Renato
l'espressione regolare che ho postato è usata su diversi server con php 5.3.29 , 5.4 e 5.5

se vai su http://regex101.com/ le due espressioni regolari sono ritenute equivalenti (verificare la spiegazione sulla destra che riporto più sotto.

se vai su https://www.debuggex.com/ e scegli come motore di espressioni regolari PCRE ( usato da PHP) la espressione regolare da te usata risulta errata .
Cannot use "\s" as the start of a range.
Forse c'è qualche particolare che ci sfugge.

Apri un altro thread per il problema htaccess

spiegazione espressioni regolari:

Code: Select all

/^[&a-zA-Z0-9\.:\s-_]+$/
    ^ assert position at start of the string
    [&a-zA-Z0-9\.:\s-_]+ match a single character present in the list below
        Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
        & a single character in the list & literally (case sensitive)
        a-z a single character in the range between a and z (case sensitive)
        A-Z a single character in the range between A and Z (case sensitive)
        0-9 a single character in the range between 0 and 9
        \. matches the character . literally
        : the literal character :
        \s match any white space character [\r\n\t\f ]
        -_ a single character in the list -_ literally
    $ assert position at end of the string

Code: Select all

/^[&a-zA-Z0-9\.\/\\:_\s-]+$/
        ^ assert position at start of the string
        [&a-zA-Z0-9\.\/\\:_\s-]+ match a single character present in the list below
            Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
            & a single character in the list & literally (case sensitive)
            a-z a single character in the range between a and z (case sensitive)
            A-Z a single character in the range between A and Z (case sensitive)
            0-9 a single character in the range between 0 and 9
            \. matches the character . literally
            \/ matches the character / literally
            \\ matches the character \ literally
            :_ a single character in the list :_ literally
            \s match any white space character [\r\n\t\f ]
            - the literal character -
        $ assert position at end of the string
Cercate nel forum le riposte prima di chiedere. Check the forum before posting
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology

http://www.joint-tech.com
---------------
Post Reply