Changeset 2133
- Timestamp:
- 03/21/10 11:56:19 (14 years ago)
- Location:
- plugins/log404Errors
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/log404Errors/_admin.php
r1012 r2133 3 3 # 4 4 # This file is part of Log 404 Errors, a plugin for Dotclear 2 5 # Copyright (C) 2009 Moe (http://gniark.net/)5 # Copyright (C) 2009,2010 Moe (http://gniark.net/) 6 6 # 7 7 # Log 404 Errors is free software; you can redistribute it and/or -
plugins/log404Errors/_define.php
r2045 r2133 3 3 # 4 4 # This file is part of Log 404 Errors, a plugin for Dotclear 2 5 # Copyright (C) 2009 Moe (http://gniark.net/)5 # Copyright (C) 2009,2010 Moe (http://gniark.net/) 6 6 # 7 7 # Log 404 Errors is free software; you can redistribute it and/or … … 26 26 /* Description*/ 'Log and display 404 errors in your administration', 27 27 /* Author */ 'Moe (http://gniark.net/)', 28 /* Version */ '0. 4.1',28 /* Version */ '0.5', 29 29 /* Permissions */ 'admin' 30 30 ); -
plugins/log404Errors/_install.php
r1172 r2133 3 3 # 4 4 # This file is part of Log 404 Errors, a plugin for Dotclear 2 5 # Copyright (C) 2009 Moe (http://gniark.net/)5 # Copyright (C) 2009,2010 Moe (http://gniark.net/) 6 6 # 7 7 # Log 404 Errors is free software; you can redistribute it and/or … … 46 46 ->dt('timestamp',0,false,'now()') 47 47 ->ip('varchar',39,true,null) 48 ->host('text',0,true,null) 48 49 ->user_agent('varchar',255,true,null) 49 50 ->referrer('text',0,true,null) -
plugins/log404Errors/_public.php
r1172 r2133 3 3 # 4 4 # This file is part of Log 404 Errors, a plugin for Dotclear 2 5 # Copyright (C) 2009 Moe (http://gniark.net/)5 # Copyright (C) 2009,2010 Moe (http://gniark.net/) 6 6 # 7 7 # Log 404 Errors is free software; you can redistribute it and/or … … 24 24 if ($core->blog->settings->log404errors_active) 25 25 { 26 $core->addBehavior('public HeadContent',27 array('log404ErrorsBehaviors','public HeadContent'));26 $core->addBehavior('publicAfterDocument', 27 array('log404ErrorsBehaviors','publicAfterDocument')); 28 28 } 29 29 30 30 class log404ErrorsBehaviors 31 31 { 32 public static function public HeadContent($core)32 public static function publicAfterDocument($core) 33 33 { 34 34 if ($core->url->type != '404') {return;} … … 51 51 $cur->dt = date("Y-m-d H:i:s"); 52 52 $cur->ip = http::realIP(); 53 $cur->host = @gethostbyaddr(http::realIP()); 53 54 $cur->user_agent = $_SERVER['HTTP_USER_AGENT']; 54 55 $cur->referrer = (isset($_SERVER['HTTP_REFERER']) -
plugins/log404Errors/index.php
r2045 r2133 3 3 # 4 4 # This file is part of Log 404 Errors, a plugin for Dotclear 2 5 # Copyright (C) 2009 Moe (http://gniark.net/)5 # Copyright (C) 2009,2010 Moe (http://gniark.net/) 6 6 # 7 7 # Log 404 Errors is free software; you can redistribute it and/or … … 150 150 <th><?php echo(__('Date')); ?></th> 151 151 <th><?php echo(__('IP address')); ?></th> 152 <th><?php echo(__('Host name')); ?></th> 152 153 <th><?php echo(__('Referrer')); ?></th> 153 154 <th><?php echo(__('User agent')); ?></th> -
plugins/log404Errors/lib.log404Errors.php
r1172 r2133 3 3 # 4 4 # This file is part of Log 404 Errors, a plugin for Dotclear 2 5 # Copyright (C) 2009 Moe (http://gniark.net/)5 # Copyright (C) 2009,2010 Moe (http://gniark.net/) 6 6 # 7 7 # Log 404 Errors is free software; you can redistribute it and/or … … 39 39 else 40 40 { 41 $query = 'SELECT id, url, dt, ip, referrer, user_agent '.41 $query = 'SELECT id, url, dt, ip, host, referrer, user_agent '. 42 42 'FROM '.$core->prefix.'errors_log '. 43 43 'WHERE (blog_id = \''.$core->con->escape( … … 54 54 while ($rs->fetch()) 55 55 { 56 $url = html::escapeHTML($rs->url); 56 $url = $rs->url; 57 58 # html::escapeHTML() is used to avoid malicious code injection 57 59 58 60 if (strlen($url) > 60) 59 61 { 60 $url = '<a href="'.$url.'" title="'.$url.'">'. 61 text::cutString($url,60).'…</a>'; 62 $url = '<a href="'.html::escapeHTML($url).'" '. 63 'title="'.html::escapeHTML($url).'">'. 64 html::escapeHTML(text::cutString($url,60)).'…</a>'; 62 65 } 63 66 else 64 67 { 65 $url = '<a href="'.$url.'" title="'.$url.'">'.$url.'</a>'; 68 $url = '<a href="'.html::escapeHTML($url).'" '. 69 'title="'.html::escapeHTML($url).'">'. 70 html::escapeHTML($url).'</a>'; 66 71 } 67 72 … … 87 92 if (strlen($referrer) > 60) 88 93 { 89 $referrer = '<a href="'.$referrer.'" title="'.$referrer.'">'. 90 text::cutString($referrer,60).'…</a>'; 94 $referrer = '<a href="'.html::escapeHTML($referrer).'" '. 95 'title="'.html::escapeHTML($referrer).'">'. 96 html::escapeHTML(text::cutString($referrer,60)).'…</a>'; 91 97 } 92 98 else 93 99 { 94 100 $referrer = '<a href="'. 95 html::escapeHTML($referrer).'">'.$referrer.'</a>'; 101 html::escapeHTML($referrer).'">'. 102 html::escapeHTML($referrer).'</a>'; 96 103 } 97 104 } … … 99 106 $ip = $rs->ip; 100 107 101 if (empty($ip)) 102 { 103 $ip = ' '; 104 } 108 $ip = ((empty($ip)) ? ' ' : html::escapeHTML($ip)); 109 110 $host = $rs->host; 111 112 $host = ((empty($host)) ? ' ' : html::escapeHTML($host)); 105 113 106 114 $user_agent = $rs->user_agent; 107 115 108 if (empty($user_agent)) 109 { 110 $user_agent = ' '; 111 } 116 $user_agent = ((empty($user_agent)) 117 ? ' ' : html::escapeHTML($user_agent)); 112 118 113 119 echo('<tr>'. … … 117 123 $core->blog->settings->blog_timezone).'</td>'. 118 124 '<td>'.$ip.'</td>'. 125 '<td>'.$host.'</td>'. 119 126 '<td>'.$referrer.'</td>'. 120 127 '<td>'.$user_agent.'</td>'. -
plugins/log404Errors/locales/fr/main.po
r2045 r2133 1 1 # Language: français 2 # Module: log404Errors - 0. 4.13 # Date: 2010-0 2-07 16:21:342 # Module: log404Errors - 0.5 3 # Date: 2010-03-21 10:51:45 4 4 # Translated with dcTranslater - 1.2 5 5 … … 7 7 msgstr "Content-Type: text/plain; charset=UTF-8\n" 8 8 9 #: index.php:17 69 #: index.php:177 10 10 msgid "404 Errors" 11 11 msgstr "Erreurs 404" … … 27 27 msgstr "Les erreurs 404 ne sont pas enregistrées." 28 28 29 #: index.php:17 429 #: index.php:175 30 30 msgid "Summary" 31 31 msgstr "Résumé" 32 32 33 #: index.php:20 133 #: index.php:202 34 34 msgid "Errors" 35 35 msgstr "Erreurs" … … 40 40 41 41 #: index.php:152 42 msgid "Host name" 43 msgstr "Nom d'hôte" 44 45 #: index.php:153 42 46 msgid "Referrer" 43 47 msgstr "Référent" 44 48 45 #: index.php:19 649 #: index.php:197 46 50 msgid "drop" 47 51 msgstr "effacer" 48 52 49 #: index.php:1 7953 #: index.php:180 50 54 msgid "Count" 51 55 msgstr "Nombre" 52 56 53 #: index.php:18 157 #: index.php:182 54 58 msgid "Date of last error" 55 59 msgstr "Date de la dernière erreur" 56 60 57 #: index.php:20 861 #: index.php:209 58 62 msgid "Settings" 59 63 msgstr "Paramètres" 60 64 61 #: index.php:21 365 #: index.php:214 62 66 msgid "Log 404 errors" 63 67 msgstr "Enregistrer les erreurs 404" 64 68 65 #: index.php:21 869 #: index.php:219 66 70 msgid "Errors per page:" 67 71 msgstr "Erreurs par page :" 68 72 69 #: index.php:22 573 #: index.php:226 70 74 msgid "Save configuration" 71 75 msgstr "Enregistrer la configuration"
Note: See TracChangeset
for help on using the changeset viewer.