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

« back to all changes in this revision

Viewing changes to modules/itemadd/ItemAddFromWeb.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 ItemAddFromWeb extends ItemAddPlugin {
29
29
 
53
53
 
54
54
        $status = $error = array();
55
55
 
 
56
        list ($ret, $hasPermission) = $this->isAppropriate();
 
57
        if ($ret) {
 
58
            return array($ret, null, null);
 
59
        }
 
60
        if (!$hasPermission) {
 
61
            return array(GalleryCoreApi::error(ERROR_PERMISSION_DENIED), null, null);
 
62
        }
 
63
 
56
64
        if (isset($form['action']['findFilesFromWebPage'])) {
57
65
            /* Delegate back to the same view */
58
66
        } else if (isset($form['action']['addFromWebPage']) && empty($form['webPageUrls'])) {
84
92
                    }
85
93
 
86
94
                    list ($base) = GalleryUtilities::getFileNameComponents($fileName);
 
95
                    GalleryUtilities::sanitizeInputValues($base);
87
96
                    $title = (isset($form['set']['title']) && $form['set']['title']) ? $base : '';
88
97
                    $summary = (isset($form['set']['summary'])
89
98
                             && $form['set']['summary']) ? $base : '';
101
110
                        return array($ret, null, null);
102
111
                    }
103
112
 
 
113
                    $sanitizedUrl = $url;
 
114
                    GalleryUtilities::sanitizeInputValues($url);
104
115
                    $status['addedFiles'][] = array('fileName' => $url,
105
116
                                                    'id' => $newItem->getId(),
106
117
                                                    'warnings' => array());