Changeset 607


Ignore:
Timestamp:
11/12/09 18:41:57 (10 months ago)
Author:
sidtheduck
Message:

First round of RC-1 bug fixes

  • Fix for double slashes when included in root directory (including fix for Windows servers)
  • Fix for add_album() returning nil or '0' id due to missing database handler when calling mysql_insert_id()
  • Removal of unneeded code in latest comments plugin
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/plog-admin/plog-admin-functions.php

    r602 r607  
    806806                $query = "INSERT INTO ".PLOGGER_TABLE_PREFIX."albums (`name`,`description`,`parent_id`,`path`) VALUES ('$sql_name', '$description', '$pid', '$album_folder')"; 
    807807                $result = run_query($query); 
    808                 $id = mysql_insert_id(); 
     808                $id = mysql_insert_id($GLOBALS['PLOGGER_DBH']); 
    809809 
    810810                $output .= sprintf(plog_tr('You have successfully created the album %s.'), '<strong>'.$album_name.'</strong>'); 
  • trunk/plog-content/plugins/latest-comments/latest-comments.php

    r601 r607  
    6767                $comment_length = intval($plog_lc_comment_trim); 
    6868                $comment = ($comment_length !== 0 && $comment_length < strlen($row['comment'])) ? substr($row['comment'], 0, intval($plog_lc_comment_trim)).' ...' : $row['comment']; 
    69                 $number = strrpos($path, '/'); 
    70                 $number = $number+1; 
    71                 $url = substr($path, $number); 
    7269                $plog_lc_picture = get_picture_by_id($parent_id); 
    7370                $cap_or_name = (!empty($plog_lc_picture['caption'])) ? stripslashes($plog_lc_picture['caption']) : ucfirst(substr(basename($plog_lc_picture['path']), 0, strrpos(basename($plog_lc_picture['path']), '.'))); 
  • trunk/plog-load-config.php

    r602 r607  
    9494// if mod_rewrite is on and we're not embedded, remove the file basename 
    9595if ($config['use_mod_rewrite'] == 1 && $config['embedded'] == 0) { 
    96         $config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/'; 
     96        $config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); 
     97        // Verify URL for a trailing slash.  If not, add one. 
     98        if ($config['baseurl']{strlen($config['baseurl'])-1} != '/') { 
     99                $config['baseurl'] = $config['baseurl'].'/'; 
     100        } 
    97101// otherwise just use our cleaned up version of $_SERVER['PHP_SELF'] from plog-globals.php 
    98102} else { 
Note: See TracChangeset for help on using the changeset viewer.