Project

General

Profile

« Previous | Next » 

Revision 2028

Added by Dietmar almost 11 years ago

  1. /modules/news/save_posts.php::title rename fix

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
14 Dec-2013 Build 2028 Dietmar Woellbrink (Luisehahne)
15
# /modules/news/save_posts.php::title rename fix
14 16
08 Dec-2013 Build 2027 Manuela v.d.Decken(DarkViper)
15 17
# some typofixes in Multilingual/tpl/lang.html.php and WbLinkAbstract
16 18
08 Dec-2013 Build 2026 Manuela v.d.Decken(DarkViper)
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '2027');
54
if(!defined('REVISION')) define('REVISION', '2028');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/modules/news/save_post.php
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
17
                    error_reporting(E_ALL);
17
    error_reporting(E_ALL);
18 18
	require('../../config.php');
19 19
	require_once(WB_PATH."/include/jscalendar/jscalendar-functions.php");
20 20
// Get post_id
......
72 72
	$publisheduntil = jscalendar_to_timestamp($admin->get_post_escaped('enddate'), $publishedwhen);
73 73
	if($publisheduntil == '' || $publisheduntil < 1) { $publisheduntil=0; }
74 74
// Update row
75
	$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_news_posts` ';
76
	$sql .= 'SET `group_id`='.(int)$group_id.', ';
77
	$sql .=     '`title`=\''.$title.'\', ';
78
	$sql .=     '`link`=\''.$newLink.'\', ';
79
	$sql .=     '`content_short`=\''.$short.'\', ';
80
	$sql .=     '`content_long`=\''.$long.'\', ';
81
	$sql .=     '`commenting`=\''.$commenting.'\', ';
82
	$sql .=     '`active`='.(int)$active.', ';
83
	$sql .=     '`published_when`='.(int)$publishedwhen.', ';
84
	$sql .=     '`published_until`='.(int)$publisheduntil.', ';
85
	$sql .=     '`posted_when`='.time().', ';
86
	$sql .=     '`posted_by`='.(int)$admin->get_user_id().' ';
87
	$sql .= 'WHERE `post_id`='.(int)$post_id;
75
	$sql  = 'UPDATE `'.TABLE_PREFIX.'mod_news_posts` '
76
          . 'SET `group_id`='.(int)$group_id.', '
77
          .     '`title`=\''.$database->escapeString($title).'\', '
78
          .     '`link`=\''.$database->escapeString($newLink).'\', '
79
          .     '`content_short`=\''.$database->escapeString($short).'\', '
80
          .     '`content_long`=\''.$database->escapeString($long).'\', '
81
          .     '`commenting`=\''.$database->escapeString($commenting).'\', '
82
          .     '`active`='.(int)$active.', '
83
          .     '`published_when`='.(int)$publishedwhen.', '
84
          .     '`published_until`='.(int)$publisheduntil.', '
85
          .     '`posted_when`='.time().', '
86
          .     '`posted_by`='.(int)$admin->get_user_id().' '
87
          . 'WHERE `post_id`='.(int)$post_id;
88 88
	if( $database->query($sql) ) {
89 89
		// create new accessfile
90 90
        $sDoWhat = (($newLink == $old_link) && (file_exists($sNewFilename))) ? "nothing" : "action";
91
// try to create the whole path to the accessfile
92
    	$sAccessPath = dirname($sNewFilename).'/';
93
    	if(!($bRetval = is_dir($sAccessPath))) {
94
    		$iOldUmask = umask(0) ;
95
    		// sanitize directory mode to 'o+rwx/g+x/u+x' and create path
96
    		$bRetval = mkdir($sAccessPath, (OCTAL_DIR_MODE |0711), true); 
97
    		umask($iOldUmask);
98
    	}
99 91
        if($sDoWhat == "action") {
100 92
            $sDoWhat = (($sDoWhat == "action") && file_exists($sOldFilename)) ? "update" : "create";
101 93
        }
......
104 96
        {
105 97
            case "update":
106 98
                try {
107
                    $oAF = new AccessFile($sOldFilename, $page_id);
108
                    $oAF->rename($sNewFile);
109
                    unset($oAF);
99
// prozedural rename accessfile if link has changed, has to be changed to accessfile class when fixed
100
            		if(($sNewFilename != $sOldFilename) && (is_writable($sOldFilename))) {
101
            			if(!rename($sOldFilename,$sNewFilename)) {
102
            				$admin->print_error($MESSAGE['PAGES_CANNOT_DELETE_ACCESS_FILE'].' - '.$oldLink,$sBackUrl);
103
            			}
104
            		}
105
//                    $oAF = new AccessFile($sOldFilename, $page_id);
106
//                    $oAF->rename($sNewFile);
107
//                    unset($oAF);
110 108
                }catch(AccessFileException $e) {
111 109
                    $admin->print_error($e,$sBackUrl);
112 110
                }

Also available in: Unified diff