Changeset 35 for trunk/lib


Ignore:
Timestamp:
Dec 13, 2005 7:43:12 AM (19 years ago)
Author:
scdev
Message:

Fixed mime_content_type bug in Upload.inc.php

Location:
trunk/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r34 r35  
    482482        $event['file:line'] = "$file : $line";
    483483        preg_match_all('/(<[^>\s]{7,})[^>]*>/', $message, $strip_tags_allow); // <...> with lots of chars maybe we don't want stripped.
    484         $event['message'] = strip_tags(preg_replace('/\s{2,}/', ' ', $message), (!empty($strip_tags_allow[1]) ? join('> ', $strip_tags_allow[1]) . '>' : null));
     484        $event['message'] = strip_tags(preg_replace('/\s+/', ' ', $message), (!empty($strip_tags_allow[1]) ? join('> ', $strip_tags_allow[1]) . '>' : null));
    485485        $event_str = '[' . join('] [', $event) . ']';
    486486       
  • trunk/lib/Auth_SQL.inc.php

    r34 r35  
    468468        // Tesing login should occur once. This is the first time. Set flag.
    469469        $this->_authentication_tested = true;
    470        
     470
    471471        // Some users will access from networks with a changing IP number (i.e. behind a proxy server). These users must be allowed entry by adding their IP to the list of trusted_networks.
    472472        if ($trusted_net = ipInRange(getRemoteAddr(), $this->_params['trusted_networks'])) {
     
    513513        } else if (isset($_SESSION[$this->_sess]) && true === $_SESSION[$this->_sess]['authenticated']) {
    514514            // User is authenticated, but login has expired.
    515             App::raiseMsg(sprintf(_("Your %s session has closed. You need to log-in again."), strtolower($this->_auth)), MSG_NOTICE, __FILE__, __LINE__);
     515            if (strtotime($_SESSION[$this->_sess]['last_access_datetime']) > time() - 43200) {
     516                // Only raise message if last session is less than 12 hours old.
     517                App::raiseMsg(sprintf(_("Your %s session has closed. You need to log-in again."), strtolower($this->_auth)), MSG_NOTICE, __FILE__, __LINE__);
     518            }
    516519           
    517520            // Log the reason for login expiration.
  • trunk/lib/Email.inc.php

    r34 r35  
    190190        array_walk($search, create_function('&$v', '$v = "/{" . preg_quote($v) . "}/i";'));
    191191
    192         // Replace values.
     192        // Replacement values.
    193193        $replace = array_values($replacements);
    194194       
  • trunk/lib/TemplateGlue.inc.php

    r34 r35  
    1515function bbftp($file)
    1616{
    17     return sprintf('<a href="bbftp://%s@%s:%s%s" title="%s">%s</a>', $_SERVER['USER'], $_SERVER['HTTP_HOST'], $_SERVER['DOCUMENT_ROOT'], $file, $file, basename($file));
     17    return sprintf('<a href="bbftp://%s@%s:%s%s" title="%s" style="text-decoration: none; border-bottom: blue 1px dotted;">%s</a>', $_SERVER['USER'], $_SERVER['HTTP_HOST'], $_SERVER['DOCUMENT_ROOT'], $file, $file, basename($file));
    1818}
    1919
     
    2929    $filepath = preg_match('!://!', $src) ? $src : getenv('DOCUMENT_ROOT') . $src;
    3030   
    31     if (false === ($gis = @getimagesize($filepath)) || preg_match('/width|height/', $extra)) {
     31    if (true === ($gis = @getimagesize($filepath)) && !preg_match('/width|height/', $extra)) {
     32        $image_size = $gis[3];
     33    } else {
    3234        $image_size = '';
    33     } else {
    34         $image_size = $gis[3];
    3535    }
    3636   
  • trunk/lib/Upload.inc.php

    r34 r35  
    300300        // To keep this script running even if user tries to stop browser.
    301301        ignore_user_abort(true);
    302         if (!ini_get('safe_mode')) {
    303             set_time_limit(300);
    304         }
     302        ini_set('max_execution_time', 300);
     303        ini_set('max_input_time', 300);
    305304
    306305        $new_file_names = array();
     
    347346            // If the file name has no extension, use the mime-type extension.
    348347            if (!preg_match('/\.[^.]{1,5}$/', $file_name) && function_exists('mime_content_type')) {
    349                 if ($ext = array_search(mime_content_type($files['type'][$i]), $this->mime_extension_map)) {
     348                if ($ext = array_search(mime_content_type($files['tmp_name'][$i]), $this->mime_extension_map)) {
    350349                    $file_name .= ".$ext";
    351350                }
Note: See TracChangeset for help on using the changeset viewer.