- Timestamp:
- Nov 24, 2013, 2:48:30 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/UserCollection.class.php
r24421 r25674 327 327 * @return: array errors 328 328 */ 329 function addShare( $share, $abord_on_duplicate=true)329 function addShare(&$share, $abord_on_duplicate=true) 330 330 { 331 331 global $conf, $page; … … 342 342 else 343 343 { 344 $share['share_key'] = $this->data['id'].'-'.str2url($share['share_key']); 344 $share['share_key'] = str2url($share['share_key']); 345 $share_key = $this->data['id'].'-'.$share['share_key']; 345 346 346 347 $query = ' 347 348 SELECT id FROM '.COLLECTION_SHARES_TABLE.' 348 349 WHERE col_id = '.$this->data['id'].' 349 AND share_key = "'.$share ['share_key'].'"350 AND share_key = "'.$share_key.'" 350 351 ;'; 351 352 $result = pwg_query($query); … … 358 359 else 359 360 { 360 return USER_COLLEC_PUBLIC . 'view/' . $share ['share_key'];361 return USER_COLLEC_PUBLIC . 'view/' . $share_key; 361 362 } 362 363 } … … 373 374 if (!empty($share['password'])) 374 375 { 375 $share['password'] = sha1($conf['secret_key'].$share['password'].$share ['share_key']);376 $share['password'] = sha1($conf['secret_key'].$share['password'].$share_key); 376 377 } 377 378 … … 392 393 VALUES( 393 394 '.$this->data['id'].', 394 "'.$share ['share_key'].'",395 "'.$share_key.'", 395 396 "'.pwg_db_real_escape_string($params).'", 396 397 "'.date('Y-m-d H:i:s').'" … … 399 400 pwg_query($query); 400 401 401 return USER_COLLEC_PUBLIC . 'view/' . $share ['share_key'];402 return USER_COLLEC_PUBLIC . 'view/' . $share_key; 402 403 } 403 404
Note: See TracChangeset
for help on using the changeset viewer.