Navigace



Regexp saves the day

So, we just upgraded one of our servers to version 7.0.2. Everything was working fine, except for some stored procedures being called by tag.

What was wrong?

Basically, the versions before 7.0.2 didn't bother if the contents of the attribute dbvarname were being sent using an "@" before or not.

It means the something like:

<cfstoredproc procedure="my_proc" datasource="#request.ds#">
   <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" dbvarname="i_id" value="#attributes.i_id#" null="No">
   <cfprocresult name="content">
</cfstoredproc>

Will become:

<cfstoredproc procedure="my_proc" datasource="#request.ds#">
   <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" dbvarname="@i_id" value="#attributes.i_id#" null="No">
   <cfprocresult name="content">
</cfstoredproc>

Apparently nothing changes, unless you have a look at the attribute dbvarname, and you'll see that an "@" was added before the variable name.

The way to fix it?

Very easy, just use your favorite IDE and replace using regular expression.

Search for: dbvarname="([^@])

Replace for: dbvarname="@\1

And it's done! The regExp says for itself as it's looking for something starting with the string dbvarname and that doesn't contain an "@" at the beginning. Then it replaces the result for the string dbvarname="@ and the variable name.

Hope it helps someone.


Comments

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer.

Search


Calendar

Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

Subscribe

Enter your email address to subscribe to this blog.


Archives By Subject

A Wee Dram 2008 (1) [RSS]
Adobe (18) [RSS]
Adobe Max 2007 (1) [RSS]
Apollo (2) [RSS]
Book Review (2) [RSS]
Books (2) [RSS]
CFDevcon06 (2) [RSS]
CFDevcon08 (2) [RSS]
CFUNITED 2008 (3) [RSS]
CFUNITED2007 (1) [RSS]
ColdFusion (36) [RSS]
Flex (3) [RSS]
Fusebox (2) [RSS]
General Techie Stuff (9) [RSS]
Javascript (4) [RSS]
JQuery (2) [RSS]
Linux (6) [RSS]
Misc (28) [RSS]
Railo (1) [RSS]
Scotch on th Rocks2007 (1) [RSS]
Tag of the day (2) [RSS]
UKCFUG (1) [RSS]

Tags

adobe coldfusion misc

Recent Entries

I'm alive!

Adds


RSS


Add to Technorati Favorites


SpamStop

This blog is protected by the SpamStop plugin and Project Honeypot.
Handled in just over 4 months:
  • Total suspicious visitors: 94
  • Harvesters: 1
  • Spammers: 47
  • and 46 where marked as suspicious.
The last shady visitor was here on November 20, 2008

In just over 4 months this blog was visited 59 times by search engines and other harmless crawlers and aggregators.

More info:
SpamStop plugin
Project Honeypot