logo       

cvs: pear /HTML_QuickForm QuickForm.php: msg#00589

Subject: cvs: pear /HTML_QuickForm QuickForm.php
mansion         Wed May 29 06:57:34 2002 EDT

  Modified files:              
    /pear/HTML_QuickForm        QuickForm.php 
  Log:
  Rules for file upload had wrong names.
  uploadedfile rule now considers element as being required.
  
Index: pear/HTML_QuickForm/QuickForm.php
diff -u pear/HTML_QuickForm/QuickForm.php:1.17 
pear/HTML_QuickForm/QuickForm.php:1.18
--- pear/HTML_QuickForm/QuickForm.php:1.17      Thu May 16 08:33:58 2002
+++ pear/HTML_QuickForm/QuickForm.php   Wed May 29 06:57:34 2002
@@ -17,7 +17,7 @@
 // |          Bertrand Mansion <bmansion@xxxxxxxxxxx>                     |
 // +----------------------------------------------------------------------+
 //
-// $Id: QuickForm.php,v 1.17 2002/05/16 12:33:58 mansion Exp $
+// $Id: QuickForm.php,v 1.18 2002/05/29 10:57:34 mansion Exp $
 
 require_once("PEAR.php");
 require_once("HTML/Common.php");
@@ -215,9 +215,9 @@
             'alphanumeric'  =>array('regex', '/^[a-zA-Z0-9]*$/'),
             'numeric'       =>array('regex', 
'/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/'),
             'uploadedfile'  =>array('function', '_ruleIsUploadedFile'),
-            'maxfilesize'   =>array('function', '_ruleCheckMaxFileSizeRule'),
-            'mimetype'      =>array('function', '_ruleCheckMimeTypeRule'),
-            'filename'      =>array('function', '_ruleCheckFileNameRule')
+            'maxfilesize'   =>array('function', '_ruleCheckMaxFileSize'),
+            'mimetype'      =>array('function', '_ruleCheckMimeType'),
+            'filename'      =>array('function', '_ruleCheckFileName')
         );
     
     /**
@@ -736,7 +736,7 @@
                 return PEAR::raiseError(null, QUICKFORM_UNREGISTERED_ELEMENT, 
null, E_USER_WARNING, "Element '$element' does not exist in 
HTML_QuickForm::addRule()", 'HTML_QuickForm_Error', true);
             }
         }
-        if ($type == 'required') {
+        if ($type == 'required' || $type == 'uploadedfile') {
             $this->_required[] = $element;
         }
         if (!isset($this->_rules[$element])) {
@@ -1378,7 +1378,7 @@
      */
     function _ruleCheckMaxFileSize($element, $value, $maxSize)
     {
-        return ($maxSize >= 
filesize($this->_submitFiles[$element]['tmp_name']));
+        return ($maxSize >= 
@filesize($this->_submitFiles[$element]['tmp_name']));
     } // end func _ruleCheckMaxFileSize
 
     // }}}



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe