[Résolu]PREG_MATCH dans un {if}

Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
#1
Citation :#~~~~~ DEBUT BLOC A NE PAS SUPPRIMER ~~~~~
#~ Version du CMS: ?
#~ Url du site : grignan.loft.galerie
#~ Hébergeur / Soft : o2switch
#~ Informations Système :
#~ ----------------------------------------------
#~ Cms Version: 2.1.2
#~ Installed Modules:
#~ AdminSearch: 1.0
#~ CGContentUtils: 2.1
#~ CGExtensions: 1.51.1
#~ CGGoogleMaps2: 0.99.3
#~ CGSimpleSmarty: 2.0.5
#~ CMSContentManager: 1.1
#~ CMSMailer: 6.2.14
#~ DesignManager: 1.1.1
#~ ExaCSS: 2.0.2
#~ FileManager: 1.5.2
#~ FormBuilder: 0.8.1.3
#~ JQueryTools: 1.3.8
#~ MicroTiny: 2.0.3
#~ MleCMS: 1.11.5
#~ ModuleManager: 2.0.2
#~ Navigator: 1.0.2
#~ News: 2.50.4
#~ Search: 1.50.2
#~ TinyMCE: 3.1.2
#~ Config Information:
#~ php_memory_limit:
#~ max_upload_size: 512000000
#~ url_rewriting: mod_rewrite
#~ page_extension: .html
#~ query_var: page
#~ auto_alias_content: true
#~ locale:
#~ set_names: true
#~ timezone: Europe/Paris
#~ permissive_smarty: false
#~ Php Information:
#~ phpversion: 5.5.32
#~ md5_function: On (Vrai)
#~ json_function: On (Vrai)
#~ gd_version: 2
#~ tempnam_function: On (Vrai)
#~ magic_quotes_runtime: Off (Faux)
#~ E_ALL: 24567
#~ E_STRICT: 2048
#~ E_DEPRECATED: 0
#~ test_file_timedifference: Aucune différence de date du système trouvée
#~ test_db_timedifference: Aucune différence de date du système trouvée
#~ create_dir_and_file: 1
#~ memory_limit: 512M
#~ max_execution_time: 120
#~ register_globals: Off (Faux)
#~ output_buffering: 4096
#~ disable_functions:
#~ open_basedir:
#~ test_remote_url: Valable
#~ file_uploads: On (Vrai)
#~ post_max_size: 512M
#~ upload_max_filesize: 512M
#~ session_save_path: /tmp (0700)
#~ session_use_cookies: On (Vrai)
#~ xml_function: On (Vrai)
#~ xmlreader_class: On (Vrai)
#~ check_ini_set: On (Vrai)
#~ curl: On
#~ Performance Information:
#~ allow_browser_cache: Off (Faux)
#~ browser_cache_expiry: 60
#~ php_opcache: On (Vrai)
#~ smarty_cache: Off (Faux)
#~ smarty_compilecheck: Off (Faux)
#~ smarty_cache_udt: Off (Faux)
#~ auto_clear_cache_age: On (Vrai)
#~ Server Information:
#~ Server Software: Apache
#~ Server Api: litespeed
#~ Server Os: Linux 2.6.32-531.29.2.lve1.3.11.10.el6.x86_64 On x86_64
#~ Server Db Type: MySQL (mysqli)
#~ Server Db Version: 5.6.28
#~ Server Db Grants: Trouvé un privilège "GRANT ALL" qui semble être adapté
#~ Permission Information:
#~ tmp: /home/farangpr/Sites/grignanloftgalerie/tmp (0755)
#~ tmp_cache: /home/farangpr/Sites/grignanloftgalerie/tmp/cache (0755)
#~ templates_c: /home/farangpr/Sites/grignanloftgalerie/tmp/templates_c (0755)
#~ modules: /home/farangpr/Sites/grignanloftgalerie/modules (0755)
#~ uploads: /home/farangpr/Sites/grignanloftgalerie/uploads (0755)
#~ Masque de création de fichier (umask) : /home/farangpr/Sites/grignanloftgalerie/tmp/cache (0755)
#~ config_file: 0644
#~ ----------------------------------------------
#~~~~~ FIN BLOC A NE PAS SUPPRIMER ~~~~~



Bonjour à tous,


Pour personnaliser un menu d'un site multilingue, je voulais utiliser la fonction preg_match dans le gabarit du menu afin d'attribuer une classe uniquement au premier node de second niveau (1.1 ou 2.1 ou 3.1 ...)
j'ai donc, fait comme ça:

Code :
[== PHP ==]
{if preg_match("/^\d[\.][1]$/", $node->hierarchy)}
     {$href_class = ['icon-home']}
{/if}

Le problème est que j'ai une erreur me disant que cette fonction est interdite:

[ins]Syntax error in template "cms_template:GLG Main Navigation" on line 27 "{if preg_match("/^\d[\.][1]$/", $hierarchy)}" PHP function 'preg_match' not allowed by security setting[/ins]

Pourquoi la fonction est interdite, et y'a-t-il une solution pour contourner cette interdiction?

Merci
#1
Citation :#~~~~~ DEBUT BLOC A NE PAS SUPPRIMER ~~~~~
#~ Version du CMS: ?
#~ Url du site : grignan.loft.galerie
#~ Hébergeur / Soft : o2switch
#~ Informations Système :
#~ ----------------------------------------------
#~ Cms Version: 2.1.2
#~ Installed Modules:
#~ AdminSearch: 1.0
#~ CGContentUtils: 2.1
#~ CGExtensions: 1.51.1
#~ CGGoogleMaps2: 0.99.3
#~ CGSimpleSmarty: 2.0.5
#~ CMSContentManager: 1.1
#~ CMSMailer: 6.2.14
#~ DesignManager: 1.1.1
#~ ExaCSS: 2.0.2
#~ FileManager: 1.5.2
#~ FormBuilder: 0.8.1.3
#~ JQueryTools: 1.3.8
#~ MicroTiny: 2.0.3
#~ MleCMS: 1.11.5
#~ ModuleManager: 2.0.2
#~ Navigator: 1.0.2
#~ News: 2.50.4
#~ Search: 1.50.2
#~ TinyMCE: 3.1.2
#~ Config Information:
#~ php_memory_limit:
#~ max_upload_size: 512000000
#~ url_rewriting: mod_rewrite
#~ page_extension: .html
#~ query_var: page
#~ auto_alias_content: true
#~ locale:
#~ set_names: true
#~ timezone: Europe/Paris
#~ permissive_smarty: false
#~ Php Information:
#~ phpversion: 5.5.32
#~ md5_function: On (Vrai)
#~ json_function: On (Vrai)
#~ gd_version: 2
#~ tempnam_function: On (Vrai)
#~ magic_quotes_runtime: Off (Faux)
#~ E_ALL: 24567
#~ E_STRICT: 2048
#~ E_DEPRECATED: 0
#~ test_file_timedifference: Aucune différence de date du système trouvée
#~ test_db_timedifference: Aucune différence de date du système trouvée
#~ create_dir_and_file: 1
#~ memory_limit: 512M
#~ max_execution_time: 120
#~ register_globals: Off (Faux)
#~ output_buffering: 4096
#~ disable_functions:
#~ open_basedir:
#~ test_remote_url: Valable
#~ file_uploads: On (Vrai)
#~ post_max_size: 512M
#~ upload_max_filesize: 512M
#~ session_save_path: /tmp (0700)
#~ session_use_cookies: On (Vrai)
#~ xml_function: On (Vrai)
#~ xmlreader_class: On (Vrai)
#~ check_ini_set: On (Vrai)
#~ curl: On
#~ Performance Information:
#~ allow_browser_cache: Off (Faux)
#~ browser_cache_expiry: 60
#~ php_opcache: On (Vrai)
#~ smarty_cache: Off (Faux)
#~ smarty_compilecheck: Off (Faux)
#~ smarty_cache_udt: Off (Faux)
#~ auto_clear_cache_age: On (Vrai)
#~ Server Information:
#~ Server Software: Apache
#~ Server Api: litespeed
#~ Server Os: Linux 2.6.32-531.29.2.lve1.3.11.10.el6.x86_64 On x86_64
#~ Server Db Type: MySQL (mysqli)
#~ Server Db Version: 5.6.28
#~ Server Db Grants: Trouvé un privilège "GRANT ALL" qui semble être adapté
#~ Permission Information:
#~ tmp: /home/farangpr/Sites/grignanloftgalerie/tmp (0755)
#~ tmp_cache: /home/farangpr/Sites/grignanloftgalerie/tmp/cache (0755)
#~ templates_c: /home/farangpr/Sites/grignanloftgalerie/tmp/templates_c (0755)
#~ modules: /home/farangpr/Sites/grignanloftgalerie/modules (0755)
#~ uploads: /home/farangpr/Sites/grignanloftgalerie/uploads (0755)
#~ Masque de création de fichier (umask) : /home/farangpr/Sites/grignanloftgalerie/tmp/cache (0755)
#~ config_file: 0644
#~ ----------------------------------------------
#~~~~~ FIN BLOC A NE PAS SUPPRIMER ~~~~~



Bonjour à tous,


Pour personnaliser un menu d'un site multilingue, je voulais utiliser la fonction preg_match dans le gabarit du menu afin d'attribuer une classe uniquement au premier node de second niveau (1.1 ou 2.1 ou 3.1 ...)
j'ai donc, fait comme ça:

Code :
[== PHP ==]
{if preg_match("/^\d[\.][1]$/", $node->hierarchy)}
     {$href_class = ['icon-home']}
{/if}

Le problème est que j'ai une erreur me disant que cette fonction est interdite:

[ins]Syntax error in template "cms_template:GLG Main Navigation" on line 27 "{if preg_match("/^\d[\.][1]$/", $hierarchy)}" PHP function 'preg_match' not allowed by security setting[/ins]

Pourquoi la fonction est interdite, et y'a-t-il une solution pour contourner cette interdiction?

Merci


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)