Enjoy the code shared with you from your fellow developers.

ryan.everhart
7/3/07 9:31 PM est.
Never
Comments:

  1. <cffunction name="onRequest" returnType="void" output="true">
  2.     <cfargument name="page" type="string" required="true" />
  3.     <cfset var pagePath = "" />
  4.     <cfset request.page = arguments.page />
  5.     <cfset pagePath = listDeleteAt(request.page,listLen(request.page,"/"),"/") />
  6.     
  7.     <cfif isDefined("form.fieldnames")>
  8.         <cfinclude template="#arguments.page#" />             
  9.     <cfelse>
  10.         <cftry>
  11.             <cfinclude template="#pagePath#/config.cfm" />
  12.             <cfcatch></cfcatch>
  13.         </cftry>
  14.         <cfinclude template="index.cfm" />
  15.     </cfif>
  16.     
  17. </cffunction>

tomcornilliac
7/12/07 1:13 PM est.
Never
Comments:

  1. <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="217" height="180" id="badge" align="middle">
  2. <param name="allowScriptAccess" value="all" />
  3. <param name="movie" value="badge.swf" />
  4. <param name="quality" value="high" />
  5. <param name="bgcolor" value="#FFFFFF" />
  6. <param name="FlashVars" value="appname=My%20Application&appurl=http://www.mydomain.com/myAirApp.air&airversion=1.0.M4&buttoncolor=CC0000&messagecolor=000000&imageurl=test.jpg" />
  7. <embed src="badge.swf" quality="high" bgcolor="#FFFFFF" width="217" height="180" name="badge" align="middle" allowScriptAccess="all" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="appname=My%20Application&appurl=http://www.mydomain.com/myAirApp.air&airversion=1.0.M4&buttoncolor=CC0000&messagecolor=000000&imageurl=test.jpg"/>
  8. </object>

ryan.everhart
7/16/07 5:56 PM est.
Never
Comments:
These two functions work together to generate a password. The first function generates a random password then based passes back the clear password and an encrypted version. The encrypted version is created using the section function.

  1. <!---
  2. +++++++++++++++++++++++++++++++
  3. +    GENERATE RANDOM PASSWORD
  4. +++++++++++++++++++++++++++++++
  5. --->
  6.     <cffunction name="generatePassword" access="public" returntype="struct" displayname="Generate Password" output="false"
  7.                 hint="function to generate a random password for a user, plain and encrypted values">
  8.     
  9.          <cfscript>
  10.             var passStruct = structNew();
  11.             var randNum = 0;
  12.             var randChar = 'a';
  13.             var passList = '';
  14.             var passLength = 8;
  15.             var alphaLower = 'a|c|e|g|i|k|m|o|q|s|u|w|y|b|d|f|h|j|l|n|p|r|t|v|x|z';
  16.             var alphaUpper = 'A|C|E|G|I|K|M|O|Q|S|U|W|Y|B|D|F|H|J|L|N|P|R|T|V|X|Z';
  17.             var numeric = '0|2|4|6|8|9|7|5|3|1';
  18.             //create a list of characters
  19.             var charlist = alphaLower & '|' & numeric & '|' & alphaUpper;
  20.             
  21.             //create the password
  22.             for (i = 1; i lte passLength; i = i + 1)
  23.                 {
  24.                     randNum = randRange(1,listlen(charlist,'|'));     //random number for the list location
  25.                     randChar = listGetAt(charList,randNum,'|');        //get character located at randNum position
  26.                     passList = listAppend(passList,randChar,' ');    //list of characters delimited by space
  27.                 }
  28.             
  29.             //remove all the spaces from the passList variable to set the new password
  30.             passStruct.plainPass = reReplace(passList,' ','','all');
  31.             //take the new password and encrypt it
  32.             passStruct.encryptPass = encryptPassword(passStruct.plainPass);
  33.             
  34.             //return the structure
  35.             return passStruct;
  36.         </cfscript>
  37.          
  38.     </cffunction>
  39. <!---
  40. +++++++++++++++++++++++++++++++
  41. +    ENCRYPT PASSWORD
  42. +++++++++++++++++++++++++++++++
  43. --->
  44.     <cffunction name="encryptPassword" access="public" returntype="string" displayname="Encrypt Password" output="false"
  45.                 hint="take a password string and encrypt the value using the password key">
  46.          <cfargument name="plainPass" type="string" required="true" default="all">
  47.     
  48.          <cfscript>
  49.              //DO NOT CHANGE
  50.             //this is the random key used to create and read passwords. if you change it all the exisiting passwords will break.
  51.             var passwordKey = 'YUndjke395jdiD3j';
  52.              
  53.             encryptPass = trim(encrypt(arguments.plainPass, passwordKey));
  54.             
  55.             return encryptPass;
  56.         </cfscript>
  57.     </cffunction>

r.d.wilkerson
9/26/07 1:06 PM est.
Never
Comments:
Simple PHP singleton

  1. <?php
  2. class FileHandler {
  3.     private static $_instance = null;
  4.     private function __construct() {
  5.         // restrict access to the constructor
  6.     }
  7.     public static function getInstance() {
  8.      if ( is_null ( self::$_instance ) ) {
  9.      self::$_instance = new self();
  10.      }
  11.      return self::$_instance;
  12.     }
  13.     /**
  14.      * Convenience function for testing.
  15.      * Clears the current instance so that it can be reinstantiated rather
  16.      * than retrieving the existing instance. Helpful when testing new
  17.      * properties, etc.
  18.      */
  19.     public function clear() {
  20.         self::$_instance = null;
  21.     }
  22.     public function save ( $rootPath, $source, $fileName, $isTemporary ) {
  23.         ...
  24.     }
  25.     public function delete ( $file ) {
  26.         ...
  27.     }
  28.     protected function getBinDir() {
  29.         return chr ( ( rand ( 0, 25 ) ) + 97 );
  30.     }
  31.     public function checkFileSize ( $file, $max ) {
  32.         ...
  33.     }
  34. }
  35. ?>

r.d.wilkerson
9/26/07 5:23 PM est.
Never
Comments:

  1. <?php
  2. class DAOFactory {
  3.     private static $_instance = null;
  4.     private static $_dbhost;
  5.     private static $_user;
  6.     private static $_password;
  7.     private static $_dbname;
  8.     private function __construct ( $host, $user, $pwd, $dbname ) {
  9.         self::$_dbhaost = $host;
  10.         self::$_user = $user;
  11.         self::$_password = $pwd;
  12.         self::$_dbname = $dbname;
  13.     }
  14.     public function clear() {
  15.         self::$_instance = null;
  16.     }
  17.     public static function getInstance() {
  18.      if ( is_null ( self::$_instance ) && func_num_args() == 4 ) {
  19.          $host = func_get_arg ( 0 );
  20.         $user = func_get_arg ( 1 );
  21.         $pwd = func_get_arg ( 2 );
  22.         $dbname = func_get_arg ( 3 );
  23.      self::$_instance = new self ( $host, $user, $pwd, $dbname );
  24.      }
  25.      return self::$_instance;
  26.     }
  27.     public function createDAO ( $classname ) {
  28.         switch ( strtoupper ( $classname ) ) {
  29.             case 'SURVEY':
  30.                 include ( 'com/adcom/creativesurvey/surveydao.php' );
  31.                 return new surveyDAO ( self::$_dbhost, self::$_user, self::$_password, self::$_dbname );
  32.                 break;
  33.             case 'CREATIVE':
  34.                 include ( 'com/adcom/creativesurvey/creativedao.php' );
  35.                 return new creativeDAO ( self::$_dbhost, self::$_user, self::$_password, self::$_dbname );
  36.                 break;
  37.         }
  38.     }
  39. }
  40. ?>

brian.rinaldi
9/27/07 11:39 AM est.
Never
Comments:
Updated code for TLA.cfc setInventory() function that integrates text-link-ads in ColdFusion. This code wraps the http call in a try to prevent errors when there are outages.

  1. <cffunction name="setInventory" access="public" output="false" returntype="void">
  2.     <cfargument name="referrer" type="string" required="false" default="" />
  3.     <cfargument name="userAgent" type="string" required="false" default="" />
  4.         
  5.     <cfset var tlaResponse = "" />
  6.     <cfset var tlaURL = "http://www.text-link-ads.com/xml.php?inventory_key=" & variables.inventoryKey />
  7.     <cfif len(arguments.referrer)>
  8.         <cfset tlaURL = tlaURL & "referer=" & arguments.referrer />
  9.     </cfif>
  10.     <cfif len(arguments.userAgent)>
  11.         <cfset tlaURL = tlaURL & "user_agent=" & arguments.userAgent />
  12.     </cfif>
  13.     <cftry>
  14.         <cfhttp url="#tlaURL#" method="get" result="tlaResponse" timeout="30" />
  15.         <cfset variables.xmlInventory = xmlParse(tlaResponse.fileContent) />
  16.         <cfcatch type="any">
  17.             <cfset variables.xmlInventory = xmlNew() />
  18.         </cfcatch>
  19.     </cftry>
  20. </cffunction>

aqlong
11/5/07 4:55 PM est.
Never
Comments:
A gereral-use way of dynamically creating SQL to easily paginate the results; also includes a total record count based on the search criteria in the WHERE clause

  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. go
  4. -- ==================================================
  5. -- Author:        Aaron Longnion
  6. -- Create date: 10/18/2007
  7. -- Description:    A gereral-use way of dynamically
  8. --        creating SQL to easily paginate the results;
  9. --        also includes a total record count based on
  10. --        the search criteria in the WHERE clause
  11. -- ==================================================
  12. ALTER PROCEDURE [dbo].[sproc_pagination]
  13.     -- Add the parameters for the stored procedure here
  14.     @SqlColumns VARCHAR(MAX),
  15.     @SqlFriendlyColumns VARCHAR(MAX),
  16.     @SqlTableClause VARCHAR(MAX),
  17.     @StartRow INT,
  18.     @EndRow INT,
  19.     @SqlWhere VARCHAR(MAX),
  20.     @SqlRowNumOrderBy VARCHAR(MAX),
  21.     @SqlOuterOrderBy VARCHAR(MAX)
  22. AS
  23. DECLARE @rsSQL NVARCHAR(MAX)
  24. DECLARE @rcSQL NVARCHAR(MAX)
  25. BEGIN
  26.     -- SET NOCOUNT ON added to prevent extra result sets from
  27.     -- interfering with SELECT statements.
  28.     SET NOCOUNT ON;
  29.     -- build pagination SQL, using StartRow and EndRow to determine
  30.     -- which results to output
  31.     SET @rsSQL = N' WITH tempTable AS ( ' +
  32.         N' SELECT ' +
  33.             @SqlColumns +
  34.         N' , ROW_NUMBER() OVER(ORDER BY ' +
  35.             @SqlRowNumOrderBy +
  36.         N' ) AS RowNumber ' +
  37.         N' FROM ' +
  38.             @SqlTableClause
  39.     IF @SqlWhere + '' <> ''
  40.         BEGIN
  41.             SET @rsSQL = @rsSQL +                 
  42.                 N' WHERE ' +
  43.                     @SqlWhere
  44.         END
  45.     SET @rsSQL = @rsSQL +
  46.         N' ) SELECT ' +
  47.             @SqlFriendlyColumns +
  48.         N' FROM tempTable ' +
  49.         N' WHERE RowNumber >= ' +
  50.             CAST(@StartRow AS NVARCHAR(32)) +
  51.         N' AND RowNumber <= ' +
  52.             CAST(@EndRow AS NVARCHAR(32)) +
  53.         N' ORDER BY ' +
  54.             @SqlOuterOrderBy
  55.     
  56.     -- uncomment PRINT to debug
  57.     --PRINT @rsSQL
  58.     EXEC sp_executesql @rsSQL
  59.     -- build second recordset simple for the count
  60.     SET @rcSQL =
  61.             N'SELECT COUNT(*) AS CountAll FROM ' +
  62.                 @SqlTableClause
  63.     IF @SqlWhere + '' <> ''
  64.         BEGIN
  65.             SET @rcSQL = @rcSQL +                 
  66.                 N' WHERE ' +
  67.                     @SqlWhere
  68.         END
  69.     
  70.     EXEC sp_executesql @rcSQL    
  71.     SET NOCOUNT OFF;
  72. END

aqlong
11/5/07 4:59 PM est.
Never
Comments:

  1. <cffunction name="searchTestimonials"
  2. output="false"
  3. access="public"
  4. returntype="struct"
  5. hint="Returns total count and recordset based on search criteria">
  6. <cfargument name="SearchCrit"
  7. required="true"
  8. type="struct"
  9. hint="Search criteria, usually passed in from the URL scope" />
  10. <cfset var StartRow = "" />
  11. <cfset var EndRow = "" />
  12. <cfset var retStruct = StructNew() />
  13. <cfparam name="Arguments.SearchCrit.Name" type="string" default="" />
  14. <cfparam name="Arguments.SearchCrit.Testimony" type="string" default="" />
  15. <cfparam name="Arguments.SearchCrit.Active" type="numeric" default="1" />
  16. <cfparam name="Arguments.SearchCrit.pg" type="numeric" default="1" />
  17. <cfparam name="Arguments.SearchCrit.RecordsPerPage" type="numeric" default="30" />
  18. <cfparam name="Arguments.SearchCrit.OrderBy" type="string" default="stamp" />
  19. <cfparam name="Arguments.SearchCrit.OrderDirection" type="string" default="DESC" />
  20. <!--- derive start and end rows --->
  21. <cfset StartRow = ((Arguments.SearchCrit.pg-1)*Arguments.SearchCrit.RecordsPerPage)+1 />
  22. <cfset EndRow = (StartRow + Arguments.SearchCrit.RecordsPerPage)-1 />
  23. <cfset retStruct = DAO.readSearch( Arguments.SearchCrit, StartRow, EndRow ) />
  24. <cfreturn retStruct />
  25. </cffunction>

aqlong
11/5/07 5:03 PM est.
Never
Comments:

  1. <!--- readSearch() --->
  2. <cffunction name="readSearch" returntype="struct" output="false" access="package" hint="Returns data that match the specified criteria">
  3. <cfargument name="SearchCrit" type="struct" required="true" hint="A structure representing the search criteria" />
  4. <cfargument name="StartRow" type="numeric" required="true" hint="First row of results" />
  5. <cfargument name="EndRow" type="numeric" required="true" hint="Last row of results" />
  6. <cfset var returnStruct = StructNew() />
  7. <cfset var SqlCols = '' />
  8. <cfset var SqlTableClause = '' />
  9. <cfset var SqlWhere = '' />
  10. <cfset var SqlOrderBy = '' />
  11. <!--- columns --->
  12. <cfsavecontent variable="SqlCols">
  13. ID, Name, Active, Caption, Testimony, StampReceived, Stamp </cfsavecontent>
  14. <!--- tables --->
  15. <cfsavecontent variable="SqlTableClause">
  16. Testimonials
  17. </cfsavecontent>
  18. <!--- conditions --->
  19. <cfoutput>
  20. <cfsavecontent variable="SqlWhere">
  21. ID > 0
  22. <cfif Len(Arguments.SearchCrit.Name)>
  23. AND name LIKE '%#Arguments.SearchCrit.Name#%'
  24. </cfif>
  25. <cfif Len(Arguments.SearchCrit.Testimony)>
  26. AND Testimony LIKE '%#Arguments.SearchCrit.Testimony#%'
  27. </cfif>
  28. AND active = #Arguments.SearchCrit.Active#
  29. </cfsavecontent>
  30. </cfoutput>
  31. <!--- order --->
  32. <!--- TODO: update to support multiple ORDER BY columns --->
  33. <cfoutput>
  34. <cfsavecontent variable="SqlOrderBy">
  35. <cfif Len(Arguments.SearchCrit.OrderBy)>
  36. #Arguments.SearchCrit.OrderBy#
  37. <cfif Len(Arguments.SearchCrit.OrderDirection)>
  38. #Arguments.SearchCrit.OrderDirection#
  39. </cfif>
  40. </cfif>
  41. </cfsavecontent>
  42. </cfoutput>
  43. <cfstoredproc procedure="sproc_paging" datasource="#Application.DSN.LDC#">
  44. <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="Columns" value="#Trim(SqlCols)#">
  45. <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="TableClause" value="#Trim(SqlTableClause)#">
  46. <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" dbvarname="StartRow" value="#Arguments.StartRow#">
  47. <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" dbvarname="EndRow" value="#Arguments.EndRow#">
  48. <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="SqlWhere" value="#Trim(SqlWhere)#">
  49. <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="SqlOrderBy" value="#Trim(SqlOrderBy)#">
  50. <!--- return data + count --->
  51. <cfprocresult name="rs" resultset="1">
  52. <cfprocresult name="recordcount" resultset="2">
  53. </cfstoredproc>
  54. <cfset returnStruct.rs = rs />
  55. <cfset returnStruct.rc = recordcount.countAll />
  56. <cfreturn returnStruct />
  57. </cffunction>

landry2104
1/30/08 1:22 PM est.
1/31/08 1:30 PM est.
Comments:

  1. /**
  2. *
  3. */
  4. package dblpq.distance;
  5. import java.util.LinkedList;
  6. import dblpq.person.Person;
  7. /**
  8. * Cette classe nous permetra de donner la distance entre deux auteurs. En d´autre terme,
  9. * elle nous donnera le nombre d´ebene qui separent deux authors...
  10. *
  11. */
  12. public class DistanceBetweenAuthors {
  13.     
  14.     private Person p1,p2;
  15.     private int distance = 0;
  16.     
  17.     public DistanceBetweenAuthors(){}
  18.     
  19. //    public DistanceBetweenAuthors( Person p1 , Person p2){
  20. //        this.p1 = p1;
  21. //        this.p2 = p2;
  22. //        
  23. //    }
  24.     
  25.     public boolean areCoAuthors(Person p1, Person p2){
  26.         
  27.         Person[] coAuthors = p1.getCoauthors();
  28.         for(Person p : coAuthors){
  29.             if(p.getName()==p2.getName()){
  30.                 return true;
  31.             }
  32.         }
  33.         return false;
  34.     }
  35.     
  36.     public int getDistance(Person p1, Person p2){
  37.         
  38.         LinkedList<Person> usedPerson = new LinkedList<Person>();
  39.         
  40.         if( areCoAuthors(p1,p2)){
  41.              distance++;
  42.         }
  43.         else{
  44.             Person[] coAuthors = p1.getCoauthors();
  45.             usedPerson.add(p1);
  46.             for (int i=0;i<coAuthors.length;i++){
  47.                 Person coAuthor = coAuthors[i];
  48.                 usedPerson.add(coAuthor);
  49.                 
  50.                 for( int j = 0 ; j< coAuthor.getCoauthors().length ;j++ ){
  51.                     Person p = coAuthor.getCoauthors()[j];
  52.                     if ( ! usedPerson.contains(p)){
  53.                         getDistance(coAuthor,p2);
  54.                         distance++;
  55.                     }
  56.                     else{}
  57.                 }
  58.             }
  59. //        }
  60.     }
  61.         return distance;
  62.     }
  63.     
  64. }

martin.sam
4/22/08 3:34 PM est.
4/23/08 3:34 PM est.
Comments:
test

  1. config/autoload.yml:
  2. class: sfAutoloadConfigHandler
  3. config/php.yml:
  4. class: sfPhpConfigHandler
  5. config/databases.yml:
  6. class: sfDatabaseConfigHandler
  7. config/settings.yml:
  8. class: sfDefineEnvironmentConfigHandler
  9. param:
  10. prefix: sf_
  11. config/app.yml:
  12. class: sfDefineEnvironmentConfigHandler
  13. param:
  14. prefix: app_
  15. config/factories.yml:
  16. class: sfFactoryConfigHandler
  17. config/bootstrap_compile.yml:
  18. class: sfCompileConfigHandler
  19. config/core_compile.yml:
  20. class: sfCompileConfigHandler
  21. config/filters.yml:
  22. class: sfFilterConfigHandler
  23. config/logging.yml:
  24. class: sfLoggingConfigHandler
  25. param:
  26. prefix: sf_logging_
  27. config/routing.yml:
  28. class: sfRoutingConfigHandler
  29. config/i18n.yml:
  30. class: sfDefineEnvironmentConfigHandler
  31. param:
  32. prefix: sf_i18n_
  33. modules/*/config/generator.yml:
  34. class: sfGeneratorConfigHandler
  35. modules/*/config/view.yml:
  36. class: sfViewConfigHandler
  37. modules/*/config/mailer.yml:
  38. class: sfDefineEnvironmentConfigHandler
  39. param:
  40. prefix: sf_mailer_
  41. module: yes
  42. modules/*/config/security.yml:
  43. class: sfSecurityConfigHandler
  44. modules/*/config/cache.yml:
  45. class: sfCacheConfigHandler
  46. modules/*/validate/*.yml:
  47. class: sfValidatorConfigHandler
  48. modules/*/config/module.yml:
  49. class: sfDefineEnvironmentConfigHandler
  50. param:
  51. prefix: mod_
  52. module: yes

doug
9/25/08 8:09 AM est.
10/23/08 8:16 AM est.
Comments:
Do you think this is overkill?

  1. <!--- Clear known empty form inputs --->
  2.     <cfif structKeyExists(attributes,"submit")>
  3.         <cfset attributes.submit="" />
  4.     </cfif>    
  5.     <cfloop collection="#attributes#" item="x">
  6.         <cfset myText = trim(attributes[x]) />
  7.         <cfif len(myText)>         
  8.             <!--- known SQL Injection attackts --->
  9.             <cfset reAttack = "^[A-F0-9]+'?(:?\s|%20)+(:?AND|OR)(:?\s|%20)" />
  10.             <cfset reAttack = ListAppend(reAttack,"^[0-9]'[0-9]","|") />    
  11.             <cfset reAttack = ListAppend(reAttack,"\b([A-Z0-9]+)(:?\s|%20)*'?(:?\s|%20)*=(:?\s|%20)*'?(:?\s|%20)*\1\b","|") />
  12.             <cfset reAttack = ListAppend(reAttack,"\bis(:?\s|%20)+(:?not(:?\s|%20)+)?null\b","|") />        
  13.             <cfset reAttack = ListAppend(reAttack,"(:?&##x?[A-F0-9]{2,3};?){2,}","|") />
  14.             <cfset reAttack = ListAppend(reAttack,"(:?%[A-F0-9]{2,2}){2,}","|") />
  15.             <cfset reAttack = ListAppend(reAttack,"/\*\*/","|") />            
  16.             <cfset reAttack = ListAppend(reAttack,"\bsysObjects\b","|") />
  17.             <cfset reAttack = ListAppend(reAttack,"\bSELECT\b","|") />
  18.             <cfset reAttack = ListAppend(reAttack,"\bUPDATE\b","|") />
  19.             <cfset reAttack = ListAppend(reAttack,"\bINSERT\b","|") />
  20.             <cfset reAttack = ListAppend(reAttack,"\bDELETE\b","|") />
  21.             <cfset reAttack = ListAppend(reAttack,"\bUNION\b","|") />
  22.             <cfset reAttack = ListAppend(reAttack,"\bDESC\b","|") />
  23.             <cfset reAttack = ListAppend(reAttack,"\bEXEC\b","|") />
  24.             <cfset reAttack = ListAppend(reAttack,"'dbo'","|") />                        
  25.             <cfif    reFindNoCase("(#reAttack#)",myText)>
  26.                 <cfthrow type="userAttack" message="Suspected attack." detail="SQL Injection." />            
  27.             </cfif>            
  28.             <!--- known Cross Site Scripting attacts --->
  29.             <cfset reAttack = "</?script\b" />
  30.             <cfset reAttack = ListAppend(reAttack,"<body\b","|") />    
  31.             <cfset reAttack = ListAppend(reAttack,"\bjavascript(:?\s|%20)*:","|") />    
  32.             <cfset reAttack = ListAppend(reAttack,"(:?\\n|\b)document\.\w","|") />    
  33.             <cfset reAttack = ListAppend(reAttack,":(:?\s|%20)*url\(","|") />    
  34.             <cfset reAttack = ListAppend(reAttack,"\bsrc(:?\s|%20)*=(:?\s|%20)*('|"")","|") />    
  35.             <cfset reAttack = ListAppend(reAttack,"\bvbscript\b","|") />            
  36.             <cfif    reFindNoCase("(#reAttack#)",myText)>
  37.                 <cfthrow type="userAttack" message="Suspected attack." detail="Cross Site Scripting." />                
  38.             </cfif>
  39.         </cfif>
  40.     </cfloop>

   

© 2008 | EverFro, L.P.