~ubuntu-branches/ubuntu/quantal/gallery2/quantal

« back to all changes in this revision

Viewing changes to modules/itemadd/ItemAddFromServer.inc

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2007-12-24 05:36:33 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071224053633-1ha6lnfqkfvpgdia
Tags: 2.2.4-1
* New upstream release (Urgency high due to security fixes.
  Closes: #457644)
* debian/control: 
  + Update Standards-Version (No changes needed)
  + Add Homepage field, remove Homepage from Description
* debian/rules: No longer set DH_COMPAT (use debian/compat instead)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * @package ItemAdd
24
24
 * @subpackage UserInterface
25
25
 * @author Bharat Mediratta <bharat@menalto.com>
26
 
 * @version $Revision: 15513 $
 
26
 * @version $Revision: 17265 $
27
27
 */
28
28
class ItemAddFromServer extends ItemAddPlugin {
29
29
 
55
55
 
56
56
        $status = $error = array();
57
57
 
 
58
        list ($ret, $hasPermission) = $this->isAppropriate();
 
59
        if ($ret) {
 
60
            return array($ret, null, null);
 
61
        }
 
62
        if (!$hasPermission) {
 
63
            return array(GalleryCoreApi::error(ERROR_PERMISSION_DENIED), null, null);
 
64
        }
 
65
 
58
66
        if (isset($form['action']['addFromLocalServer'])
59
67
                && (!empty($form['localServerFiles']) || !empty($form['localServerDirectories']))) {
60
68
            /* Add the selected items */
179
187
            return $ret;
180
188
        }
181
189
 
182
 
        $status['addedFiles'][] = array('fileName' => GalleryCoreApi::convertToUtf8($fileName),
 
190
        $safeFilename = GalleryCoreApi::convertToUtf8($fileName);
 
191
        GalleryUtilities::sanitizeInputValues($safeFilename);
 
192
        $status['addedFiles'][] = array('fileName' => $safeFilename,
183
193
                                        'id' => $newItem->getId(),
184
194
                                        'warnings' => array());
185
195
 
204
214
        /* Create new Album */
205
215
        $dirName = basename($path);
206
216
        $dirNameUtf8 = GalleryCoreApi::convertToUtf8($dirName);
 
217
        GalleryUtilities::sanitizeInputValues($dirNameUtf8);
207
218
        $dirTitle = $textFields['title'] ? $dirNameUtf8 : null;
208
219
        $dirSummary = $textFields['summary'] ? $dirNameUtf8 : null;
209
220
        $dirDescription = $textFields['description'] ? $dirNameUtf8 : null;