Changeset 12726 for trunk/include
- Timestamp:
- Dec 13, 2011, 3:42:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r12724 r12726 1635 1635 1636 1636 // does the image already exists ? 1637 if ('md5sum' == $conf['uniqueness_mode']) 1638 { 1639 $where_clause = "md5sum = '".$params['original_sum']."'"; 1640 } 1641 if ('filename' == $conf['uniqueness_mode']) 1642 { 1643 $where_clause = "file = '".$params['original_filename']."'"; 1644 } 1645 1646 $query = ' 1637 if ($params['check_uniqueness']) 1638 { 1639 if ('md5sum' == $conf['uniqueness_mode']) 1640 { 1641 $where_clause = "md5sum = '".$params['original_sum']."'"; 1642 } 1643 if ('filename' == $conf['uniqueness_mode']) 1644 { 1645 $where_clause = "file = '".$params['original_filename']."'"; 1646 } 1647 1648 $query = ' 1647 1649 SELECT 1648 1650 COUNT(*) AS counter … … 1650 1652 WHERE '.$where_clause.' 1651 1653 ;'; 1652 list($counter) = pwg_db_fetch_row(pwg_query($query)); 1653 if ($counter != 0) { 1654 return new PwgError(500, 'file already exists'); 1654 list($counter) = pwg_db_fetch_row(pwg_query($query)); 1655 if ($counter != 0) { 1656 return new PwgError(500, 'file already exists'); 1657 } 1655 1658 } 1656 1659
Note: See TracChangeset
for help on using the changeset viewer.