[SPIP] ~maj v3.2.9-->v3.2.11
[lhc/web/www.git] / www / ecrire / inc / utils.php
index a89658a..afc4fbc 100644 (file)
@@ -328,9 +328,12 @@ function spip_log($message = null, $name = null) {
        if (!isset($regs[1]) or !$logname = $regs[1]) {
                $logname = null;
        }
-       if (!isset($regs[2]) or !$niveau = $regs[2]) {
+       if (!isset($regs[2])) {
                $niveau = _LOG_INFO;
        }
+       else {
+               $niveau = intval($regs[2]);
+       }
 
        if ($niveau <= (defined('_LOG_FILTRE_GRAVITE') ? _LOG_FILTRE_GRAVITE : _LOG_INFO_IMPORTANTE)) {
                if (!$pre) {
@@ -2741,9 +2744,11 @@ function spip_initialisation_suite() {
        // les anciens IIS n'acceptent pas les POST sur ecrire/ (#419)
        // meme pb sur thttpd cf. http://forum.spip.net/fr_184153.html
        if (!defined('_SPIP_ECRIRE_SCRIPT')) {
-               define('_SPIP_ECRIRE_SCRIPT', (empty($_SERVER['SERVER_SOFTWARE']) ? '' :
-                       preg_match(',IIS|thttpd,', $_SERVER['SERVER_SOFTWARE']) ?
-                               'index.php' : ''));
+               if (!empty($_SERVER['SERVER_SOFTWARE']) and preg_match(',IIS|thttpd,', $_SERVER['SERVER_SOFTWARE'])) {
+                       define('_SPIP_ECRIRE_SCRIPT', 'index.php');
+               } else {
+                       define('_SPIP_ECRIRE_SCRIPT', '');
+               }
        }