rem: if (!param.topic.isURL()) 
add: if (String.URLPATTERN.test(param.topic)) 
context: function evalImg(param, creator) {   if (param.uploadError) {      // looks like the file uploaded has exceeded uploadLimit ...      throw new Exception("imageFileTooBig");   } else if (!param.rawimage || param.rawimage.contentLength == 0) {      // looks like nothing was uploaded ...      throw new Exception("imageNoUpload");   } else if (param.rawimage && (!param.rawimage.contentType || !evalImgType(param.rawimage.contentType))) {      // whatever the user has uploaded wasn't recognized as an image      throw new Exception("imageNoImage");   }   var filesize = Math.round(param.rawimage.contentLength / 1024);   if (this._parent.getDiskUsage() + filesize > this._parent.getDiskQuota()) {      // disk quota has already been exceeded      throw new Exception("siteQuotaExceeded");   }   var newImg = new Image(creator);   // if no alias given try to determine it   if (!param.alias)      newImg.alias = buildAliasFromFile(param.rawimage, this);   else {      if (!param.alias.isFileName())         throw new Exception("noSpecialChars");      newImg.alias = buildAlias(param.alias, this);   }   // check name of topic (if specified)   var topicName = null;   if (param.topic) {      if (!param.topic.isURL())         throw new Exception("topicNoSpecialChars");      topicName = param.topic;   } else if (param.addToTopic)      topicName = param.addToTopic;   newImg.topic = topicName;   // store properties necessary for saving image on disk   newImg.filename = newImg.alias;   // check if user wants to resize image   var maxWidth = param.maxwidth ? parseInt(param.maxwidth, 10) : null;   var maxHeight = param.maxheight ? parseInt(param.maxheight, 10) : null;   // save/resize the image   var dir = this._parent.getStaticDir("images");   newImg.save(param.rawimage, dir, maxWidth, maxHeight);   // the fullsize-image is on disk, so we add the image-object (and create the thumbnail-image too)   newImg.alttext = param.alttext;   if (!this.add(newImg))      throw new Exception("imageAdd");   // the fullsize-image is stored, so we check if a thumbnail should be created too   if (newImg.width > THUMBNAILWIDTH)      newImg.createThumbnail(param.rawimage, dir);   // send e-mail notification   if (newImg.site && newImg.site.isNotificationEnabled())      newImg.site.sendNotification("upload", newImg);   newImg.site.diskusage += newImg.filesize;   var result = new Message("imageCreate", newImg.alias, newImg);   result.url = newImg.href();   return result;}
meta: 993	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/993/c965e1790e2b331d6349100474dcc70c862a86fe/objectFunctions.js/buggy/code/ImageMgr/objectFunctions.js