Changeset 20012 for extensions
- Timestamp:
- Jan 9, 2013, 12:03:22 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ExtendedDescription/main.inc.php
r19840 r20012 33 33 { 34 34 global $user; 35 $user_lang = substr($user['language'], 0, 2); 36 } 37 38 if (!substr_count(strtolower($desc), '[lang=' . $user_lang . ']')) 35 $user_lang = $user['language']; 36 } 37 38 $small_user_lang = substr($user['language'], 0, 2); 39 40 if (!preg_match('#\[lang=('.$user_lang.'|'.$small_user_lang.')\]#i', $desc)) 39 41 { 40 42 $user_lang = 'default'; 41 } 42 43 if (substr_count(strtolower($desc), '[lang=' . $user_lang . ']')) 43 $small_user_lang = 'default'; 44 } 45 46 if (preg_match('#\[lang=('.$user_lang.'|'.$small_user_lang.')\]#i', $desc)) 44 47 { 45 48 // la balise avec la langue de l'utilisateur a été trouvée 46 $patterns[] = '#(^|\[/lang\])(.*?)(\[lang=(' . $user_lang . '| all)\]|$)#is';49 $patterns[] = '#(^|\[/lang\])(.*?)(\[lang=(' . $user_lang . '|' . $small_user_lang . '|all)\]|$)#is'; 47 50 $replacements[] = ''; 48 $patterns[] = '#\[lang=(' . $user_lang . '| all)\](.*?)\[/lang\]#is';51 $patterns[] = '#\[lang=(' . $user_lang . '|' . $small_user_lang . '|all)\](.*?)\[/lang\]#is'; 49 52 $replacements[] = '\\1'; 50 53 }
Note: See TracChangeset
for help on using the changeset viewer.