r77119 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77118‎ | r77119 | r77120 >
Date:23:29, 22 November 2010
Author:awjrichards
Status:resolved (Comments)
Tags:
Comment:
Adding support for 'rapid html' forms
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php (added) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html (added) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/demo.html (added) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -107,12 +107,12 @@
108108 require_once( 'includes/payflowUser.inc' );
109109
110110 $payflow_data = payflowUser();
111 -
 111+
112112 // make a log entry if the user has submitted the cc form
113113 if ( $wgRequest->wasPosted() && $wgRequest->getText( 'process', 0 )) {
114114 wfDebugLog( 'payflowpro_gateway', $payflow_data[ 'order_id' ] . " Transaction initiated." );
115115 }
116 -
 116+
117117 // if _cache_ is requested by the user, do not set a session/token; dynamic data will be loaded via ajax
118118 if ( $wgRequest->getText( '_cache_', false ) ) {
119119 $cache = true;
@@ -158,6 +158,7 @@
159159
160160 // Check form for errors and redisplay with messages
161161 $form_errors = $this->fnPayflowValidateForm( $data, $this->errors );
 162+
162163 if ( $form_errors ) {
163164 $this->fnPayflowDisplayForm( $data, $this->errors );
164165 } else { // The submitted form data is valid, so process it
@@ -256,7 +257,6 @@
257258 }
258259 }
259260 }
260 -
261261 $this->form_class = $class_name;
262262 }
263263
@@ -299,7 +299,7 @@
300300
301301 // find all empty fields and create message
302302 foreach ( $data as $key => $value ) {
303 - if ( $value == '' || $data['state'] == 'YY' ) {
 303+ if ( $value == '' || ($key == 'state' && $value == 'YY' )) {
304304 // ignore fields that are not required
305305 if ( isset( $msg[$key] ) ) {
306306 $error[$key] = "**" . wfMsg( 'payflowpro_gateway-error-msg', $msg[$key] ) . "**<br />";
@@ -376,7 +376,6 @@
377377
378378
379379 } // end switch
380 -
381380 return $error_result;
382381 }
383382
@@ -471,9 +470,9 @@
472471 if ( $headers['http_code'] != 200 ) {
473472 $wgOut->addHTML( '<h3>No response from credit card processor. Please try again later!</h3><p>' );
474473 $when = time();
475 - wfDebugLog( 'payflowpro_gateway', $data[ 'order_id' ] . ' No response from credit card processor ' . $when );
 474+ wfDebugLog( 'payflowpro_gateway', $data[ 'order_id' ] . ' No response from credit card processor: ' . curl_error( $ch ));
476475 curl_close( $ch );
477 - exit;
 476+ return;
478477 }
479478
480479 curl_close( $ch );
@@ -943,6 +942,9 @@
944943 * @return int The id for the reference URL - 0 if not found
945944 */
946945 function get_owa_ref_id( $ref ) {
 946+ if ( !defined( 'OWA' ) ) {
 947+ return 0;
 948+ }
947949 // Replication lag means sometimes a new event will not exist in the table yet
948950 $dbw = payflowGatewayConnection();
949951 $id_num = $dbw->selectField(
@@ -979,7 +981,7 @@
980982 }
981983
982984 // if we're in testing mode and an action hasn't yet be specified, prepopulate the form
983 - if ( !$wgRequest->getText( 'action', false ) && !$numAttempt && $wgPayflowGatewayTest ) {
 985+ if ( !$wgRequest->getText( 'action', false ) && !$wgRequest->getText( 'process', 0 ) && $wgPayflowGatewayTest ) {
984986 // define arrays of cc's and cc #s for random selection
985987 $cards = array( 'american' );
986988 $card_nums = array(
@@ -1006,8 +1008,8 @@
10071009 'state' => 'CA',
10081010 'zip' => '94104',
10091011 'country' => 840,
 1012+ 'card_num' => $card_nums[ $cards[ $card_index ]][ $card_num_index ],
10101013 'card' => $cards[ $card_index ],
1011 - 'card_num' => $card_nums[ $cards[ $card_index ]][ $card_num_index ],
10121014 'expiration' => date( 'my', strtotime( '+1 year 1 month' ) ),
10131015 'cvv' => '001',
10141016 'currency' => 'USD',
@@ -1019,8 +1021,8 @@
10201022 'utm_medium' => $wgRequest->getText( 'utm_medium' ),
10211023 'utm_campaign' => $wgRequest->getText( 'utm_campaign' ),
10221024 'language' => 'en',
 1025+ 'comment-option' => $wgRequest->getText( 'comment-option' ),
10231026 'comment' => $wgRequest->getText( 'comment' ),
1024 - 'comment-option' => $wgRequest->getText( 'comment-option' ),
10251027 'email-opt' => $wgRequest->getText( 'email-opt' ),
10261028 'test_string' => $wgRequest->getText( 'process' ),
10271029 'token' => $token,
@@ -1043,9 +1045,9 @@
10441046 'city' => $wgRequest->getText( 'city' ),
10451047 'state' => $wgRequest->getText( 'state' ),
10461048 'zip' => $wgRequest->getText( 'zip' ),
1047 - 'country' => $wgRequest->getText( 'country' ),
 1049+ 'country' => $wgRequest->getText( 'country', "840" ),
 1050+ 'card_num' => str_replace( ' ', '', $wgRequest->getText( 'card_num' ) ),
10481051 'card' => $wgRequest->getText( 'card' ),
1049 - 'card_num' => str_replace( ' ', '', $wgRequest->getText( 'card_num' ) ),
10501052 'expiration' => $wgRequest->getText( 'mos' ) . substr( $wgRequest->getText( 'year' ), 2, 2 ),
10511053 'cvv' => $wgRequest->getText( 'cvv' ),
10521054 'currency' => $wgRequest->getText( 'currency_code' ),
@@ -1058,8 +1060,8 @@
10591061 'utm_campaign' => $wgRequest->getText( 'utm_campaign' ),
10601062 // try to honr the user-set language (uselang), otherwise the language set in the URL (language)
10611063 'language' => $wgRequest->getText( 'uselang', $wgRequest->getText( 'language' ) ),
 1064+ 'comment-option' => $wgRequest->getText( 'comment-option' ),
10621065 'comment' => $wgRequest->getText( 'comment' ),
1063 - 'comment-option' => $wgRequest->getText( 'comment-option' ),
10641066 'email-opt' => $wgRequest->getText( 'email-opt' ),
10651067 'test_string' => $wgRequest->getText( 'process' ), // for showing payflow string during testing
10661068 'token' => $token,
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/demo.html
@@ -0,0 +1,161 @@
 2+<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td id="appeal" valign="top"><h2 id="appeal-head"> <span class="mw-headline" id="An_appeal_from_Wikipedia_founder_Jimmy_Wales">An appeal from Wikipedia founder Jimmy Wales</span></h2>
 3+<div class="plainlinks" id="appeal-body">I got a lot of funny looks ten years ago when I started talking to people about Wikipedia.
 4+<p>Let’s just say some people were skeptical of the notion that volunteers from all across the world could come together to create a remarkable pool of human knowledge – all for the simple purpose of sharing.</p>
 5+<p>No ads. No agenda. No strings attached.</p>
 6+<p>A decade after its founding, nearly 400 million people use Wikipedia and its sister sites every month - almost a third of the Internet-connected world.</p>
 7+<p>It is the 5th most popular website in the world but Wikipedia isn’t anything like a commercial website. It is a community creation, written by volunteers making one entry at a time. You are part of our community. And I’m writing today to ask you to protect and sustain Wikipedia.</p>
 8+<p>Together, we can keep it free of charge and free of advertising. We can keep it open – you can use the information in Wikipedia any way you want. We can keep it growing – spreading knowledge everywhere, and inviting participation from everyone.</p>
 9+
 10+<p>Each year at this time, we reach out to ask you and others all across the Wikimedia community to help sustain our joint enterprise with a modest donation of $20, $35, $50 or more.</p>
 11+<p>If you value Wikipedia as a source of information – and a source of inspiration – I hope you’ll choose to act right now.</p>
 12+<p>All the best,</p>
 13+<p><b>Jimmy Wales</b></p>
 14+<p>Founder, Wikipedia</p>
 15+<p>P.S. Wikipedia is about the power of people like us to do extraordinary things. People like us write Wikipedia, one word at a time. People like us fund it, one donation at a time. It's proof of our collective potential to change the world.</p>
 16+<p><br />
 17+</p>
 18+</div>
 19+</td><td id="donate" valign="top">
 20+<noscript><div id="noscript"><p id="noscript-msg">It appears that you do not have JavaScript enabled, or your browser does not support it.
 21+In order to provide a safe, secure and pleasant experience, our donation form requires JavaScript.</p><p id="noscript-redirect-msg">If you cannot or do not wish to enable JavaScript, you may still contribute by visiting:</p><p id="noscript-redirect-link"><a href="http://wikimediafoundation.org/wiki/DonateNonJS/en">http://wikimediafoundation.org/wiki/DonateNonJS/en</a></p></div></noscript>
 22+
 23+<h2 id="donate-head">Make your donation now</h2>
 24+<p class='creditcard-error-msg'>#general</p>
 25+<form name="payment" method="post" action="/index.php/Special:PayflowProGateway?form_name=RapidHtml&amp;ffname=demo" autocomplete="off">
 26+ <div id="payflowpro_gateway-personal-info"><table id="payflow-table-donor">
 27+ <tr>
 28+ <td colspan=2><span class="creditcard-error-msg">#fname</span></td>
 29+ </tr>
 30+ <tr>
 31+ <td colspan=2><span class="creditcard-error-msg">#lname</span></td>
 32+ </tr>
 33+ <tr>
 34+ <td class="label"><label for="fname">Name</label></td>
 35+ <td>
 36+ <input name="fname" size="30" value="@fname" type="text" onfocus="clearField( this, &#039;First&#039; )" maxlength="25" class="required" id="fname" />
 37+ <input name="lname" size="30" value="@lname" type="text" onfocus="clearField( this, &#039;Last&#039; )" maxlength="25" id="lname" />
 38+ </td>
 39+ </tr>
 40+ <tr>
 41+ <td colspan=2><span class="creditcard-error-msg">#emailAdd</span></td>
 42+ </tr>
 43+ <tr>
 44+ <td class="label"><label for="emailAdd">Email address</label></td>
 45+ <td><input name="emailAdd" size="30" value="@emailAdd" type="text" maxlength="64" id="emailAdd" class="fullwidth" /></td>
 46+ </tr>
 47+ <tr>
 48+ <td colspan="2"><span class="creditcard-error-msg">#amount</span></td>
 49+ </tr>
 50+ <tr>
 51+ <td class="label"><label for="amount">Amount</label></td>
 52+ <td>
 53+ <input name="amount" size="7" value="@amount" type="text" maxlength="10" id="amount" />
 54+ <select name="currency_code" id="input_currency_code">
 55+ <option value="USD">USD: U.S. Dollar</option><option value="GBP">GBP: British Pound</option><option value="EUR">EUR: Euro</option><option value="AUD">AUD: Australian Dollar</option><option value="CAD">CAD: Canadian Dollar</option><option value="JPY">JPY: Japanese Yen</option>
 56+ </select>
 57+ </td>
 58+ </tr>
 59+ <tr>
 60+ <td />
 61+ <td><img src="/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" /></td>
 62+ </tr>
 63+ <tr>
 64+ <td class="label"><label for="card_num">Card number</label></td>
 65+ <td><input name="card_num" size="30" value="@card_num" type="text" maxlength="100" id="card_num" class="fullwidth" autocomplete="off" /></td>
 66+ </tr>
 67+ <tr>
 68+ <td colspan=2><span class="creditcard-error-msg">#cvv</span></td>
 69+ <tr>
 70+ <td class="label"><label for="cvv">Security code</label></td>
 71+ <td><input name="cvv" size="5" value="@cvv" type="text" maxlength="10" id="cvv" autocomplete="off" /> <a href="javascript:PopupCVV();">Where is this?</a></td>
 72+ </tr>
 73+ <tr>
 74+ <td class="label"><label for="expiration">Expiration date</label></td>
 75+ <td>
 76+ <select name="mos" id="expiration">
 77+ <option value="01">1 (January)</option><option value="02">2 (February)</option><option value="03">3 (March)</option><option value="04">4 (April)</option><option value="05">5 (May)</option><option value="06">6 (June)</option><option value="07">7 (July)</option><option value="08">8 (August)</option><option value="09">9 (September)</option><option value="10">10 (October)</option><option value="11">11 (November)</option><option value="12">12 (December)</option>
 78+ </select>
 79+ <select name="year" id="year">
 80+ <option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option>
 81+ </select>
 82+ </td>
 83+ </tr>
 84+ <tr>
 85+ <td colspan=2><span class="creditcard-error-msg">#street</span></td>
 86+ </tr>
 87+ <tr>
 88+ <td class="label"><label for="street">Street</label></td>
 89+ <td><input name="street" size="30" value="@street" type="text" maxlength="100" id="street" class="fullwidth" /></td>
 90+ </tr>
 91+ <tr>
 92+ <td colspan=2><span class="creditcard-error-msg">#city</span></td>
 93+ </tr>
 94+ <tr>
 95+ <td class="label"><label for="city">City</label></td>
 96+ <td><input name="city" size="30" value="@city" type="text" maxlength="40" id="city" class="fullwidth" /></td>
 97+ </tr>
 98+ <tr>
 99+ <td colspan=2><span class="creditcard-error-msg">#state</span></td>
 100+ </tr>
 101+ <tr>
 102+ <td class="label"><label for="state">State</label></td>
 103+ <td>
 104+ <select name="state" id="state">
 105+ <option value="YY">Select a State</option><option value="XX">Outside the U.S.</option><option value="AK">Alaska</option><option value="AL">Alabama</option><option value="AR">Arkansas</option><option value="AZ">Arizona</option><option value="CA">California</option><option value="CO">Colorado</option><option value="CT">Connecticut</option><option value="DC">Washington D.C.</option><option value="DE">Delaware</option><option value="FL">Florida</option><option value="GA">Georgia</option><option value="HI">Hawaii</option><option value="IA">Iowa</option><option value="ID">Idaho</option><option value="IL">Illinois</option><option value="IN">Indiana</option><option value="KS">Kansas</option><option value="KY">Kentucky</option><option value="LA">Louisiana</option><option value="MA">Massachusetts</option><option value="MD">Maryland</option><option value="ME">Maine</option><option value="MI">Michigan</option><option value="MN">Minnesota</option><option value="MO">Missouri</option><option value="MS">Mississippi</option><option value="MT">Montana</option><option value="NC">North Carolina</option><option value="ND">North Dakota</option><option value="NE">Nebraska</option><option value="NH">New Hampshire</option><option value="NJ">New Jersey</option><option value="NM">New Mexico</option><option value="NV">Nevada</option><option value="NY">New York</option><option value="OH">Ohio</option><option value="OK">Oklahoma</option><option value="OR">Oregon</option><option value="PA">Pennsylvania</option><option value="PR">Puerto Rico</option><option value="RI">Rhode Island</option><option value="SC">South Carolina</option><option value="SD">South Dakota</option><option value="TN">Tennessee</option><option value="TX">Texas</option><option value="UT">Utah</option><option value="VA">Virginia</option><option value="VT">Vermont</option><option value="WA">Washington</option><option value="WI">Wisconsin</option><option value="WV">West Virginia</option><option value="WY">Wyoming</option><option value="AA">AA</option><option value="AE">AE</option><option value="AP">AP</option>
 106+ </select>
 107+ </td>
 108+ </tr>
 109+ <tr>
 110+ <td colspan=2><span class="creditcard-error-msg">#zip</span></td>
 111+ </tr>
 112+ <tr>
 113+ <td class="label"><label for="zip">Postal code</label></td>
 114+ <td><input name="zip" size="30" value="@zip" type="text" maxlength="9" id="zip" class="fullwidth" /></td>
 115+ </tr>
 116+ <tr>
 117+ <td colspan=2><span class="creditcard-error-msg">#country</span></td>
 118+ </tr>
 119+ <tr>
 120+ <td class="label"><label for="country">Country/Region</label></td>
 121+ <td>
 122+ <select name="country" id="country" onchange="return disableStates( this )">
 123+ <option value="004">Afghanistan</option><option value="008">Albania</option><option value="012">Algeria</option><option value="016">American Samoa</option><option value="020">Andorra</option><option value="024">Angola</option><option value="660">Anguilla</option><option value="010">Antarctica</option><option value="028">Antigua and Barbuda</option><option value="032">Argentina</option><option value="051">Armenia</option><option value="533">Aruba</option><option value="036">Australia</option><option value="040">Austria</option><option value="031">Azerbaijan</option><option value="044">Bahamas</option><option value="048">Bahrain</option><option value="050">Bangladesh</option><option value="052">Barbados</option><option value="112">Belarus</option><option value="056">Belgium</option><option value="084">Belize</option><option value="204">Benin</option><option value="060">Bermuda</option><option value="064">Bhutan</option><option value="068">Bolivia, Plurinational State of</option><option value="070">Bosnia and Herzegovina</option><option value="072">Botswana</option><option value="074">Bouvet Island</option><option value="076">Brazil</option><option value="086">British Indian Ocean Territory</option><option value="096">Brunei Darussalam</option><option value="100">Bulgaria</option><option value="854">Burkina Faso</option><option value="108">Burundi</option><option value="116">Cambodia</option><option value="120">Cameroon</option><option value="124">Canada</option><option value="132">Cape Verde</option><option value="136">Cayman Islands</option><option value="140">Central African Republic</option><option value="148">Chad</option><option value="152">Chile</option><option value="156">China</option><option value="162">Christmas Island</option><option value="166">Cocos (Keeling) Islands</option><option value="017">Colombia</option><option value="174">Comoros</option><option value="178">Congo</option><option value="180">Congo, the Democratic Republic of the</option><option value="184">Cook Islands</option><option value="188">Costa Rica</option><option value="384">Cote D'Ivoire</option><option value="191">Croatia</option><option value="192">Cuba</option><option value="196">Cyprus</option><option value="203">Czech Republic</option><option value="208">Denmark</option><option value="262">Djibouti</option><option value="212">Dominica</option><option value="214">Dominican Republic</option><option value="626">East Timor</option><option value="218">Ecuador</option><option value="818">Egypt</option><option value="222">El Salvador</option><option value="226">Equatorial Guinea</option><option value="232">Eritrea</option><option value="233">Estonia</option><option value="231">Ethiopia</option><option value="238">Falkland Islands (Malvinas)</option><option value="234">Faroe Islands</option><option value="242">Fiji</option><option value="246">Finland</option><option value="250">France</option><option value="254">French Guiana</option><option value="258">French Polynesia</option><option value="260">French Southern Territories</option><option value="266">Gabon</option><option value="270">Gambia</option><option value="268">Georgia</option><option value="276">Germany</option><option value="288">Ghana</option><option value="292">Gibraltar</option><option value="300">Greece</option><option value="304">Greenland</option><option value="308">Grenada</option><option value="312">Guadeloupe</option><option value="316">Guam</option><option value="320">Guatemala</option><option value="324">Guinea</option><option value="624">Guinea-Bissau</option><option value="328">Guyana</option><option value="332">Haiti</option><option value="334">Heard Island and McDonald Islands</option><option value="340">Honduras</option><option value="344">Hong Kong</option><option value="348">Hungary</option><option value="352">Iceland</option><option value="356">India</option><option value="360">Indonesia</option><option value="364">Iran, Islamic Republic of</option><option value="368">Iraq</option><option value="372">Ireland</option><option value="376">Israel</option><option value="380">Italy</option><option value="388">Jamaica</option><option value="392">Japan</option><option value="400">Jordan</option><option value="398">Kazakhstan</option><option value="404">Kenya</option><option value="296">Kiribati</option><option value="408">Korea, Democratic People's Republic of</option><option value="410">Korea, Republic of</option><option value="414">Kuwait</option><option value="417">Kyrgyzstan</option><option value="418">Laos</option><option value="428">Latvia</option><option value="422">Lebanon</option><option value="426">Lesotho</option><option value="430">Liberia</option><option value="434">Libyan Arab Jamahiriya</option><option value="438">Liechtenstein</option><option value="440">Lithuania</option><option value="442">Luxembourg</option><option value="446">Macao</option><option value="807">Macedonia</option><option value="450">Madagascar</option><option value="454">Malawi</option><option value="458">Malaysia</option><option value="462">Maldives</option><option value="466">Mali</option><option value="470">Malta</option><option value="584">Marshall Islands</option><option value="474">Martinique</option><option value="478">Mauritania</option><option value="480">Mauritius</option><option value="175">Mayotte</option><option value="484">Mexico</option><option value="583">Micronesia, Federated States of</option><option value="498">Moldova, Republic of</option><option value="492">Monaco</option><option value="496">Mongolia</option><option value="499">Montenegro</option><option value="500">Montserrat</option><option value="504">Morocco</option><option value="508">Mozambique</option><option value="104">Myanmar</option><option value="516">Namibia</option><option value="520">Nauru</option><option value="524">Nepal</option><option value="528">Netherlands</option><option value="530">Netherlands Antilles</option><option value="540">New Caledonia</option><option value="554">New Zealand</option><option value="558">Nicaragua</option><option value="562">Niger</option><option value="566">Nigeria</option><option value="570">Niue</option><option value="574">Norfolk Island</option><option value="580">Northern Mariana Islands</option><option value="578">Norway</option><option value="512">Oman</option><option value="586">Pakistan</option><option value="585">Palau</option><option value="591">Panama</option><option value="598">Papua New Guinea</option><option value="600">Paraguay</option><option value="604">Peru</option><option value="608">Philippines</option><option value="612">Pitcairn</option><option value="616">Poland</option><option value="620">Portugal</option><option value="630">Puerto Rico</option><option value="634">Qatar</option><option value="642">Romania</option><option value="643">Russian Federation</option><option value="646">Rwanda</option><option value="654">Saint Helena</option><option value="659">Saint Kitts and Nevis</option><option value="662">Saint Lucia</option><option value="666">Saint Pierre and Miquelon</option><option value="670">Saint Vincent and the Grenadines</option><option value="674">San Marino</option><option value="678">Sao Tome and Principe</option><option value="682">Saudi Arabia</option><option value="686">Senegal</option><option value="688">Serbia</option><option value="690">Seychelles</option><option value="694">Sierra Leone</option><option value="702">Singapore</option><option value="703">Slovakia</option><option value="705">Slovenia</option><option value="090">Solomon Islands</option><option value="706">Somalia</option><option value="710">South Africa</option><option value="724">Spain</option><option value="144">Sri Lanka</option><option value="736">Sudan</option><option value="740">Suriname</option><option value="744">Svalbard and Jan Mayen</option><option value="748">Swaziland</option><option value="752">Sweden</option><option value="756">Switzerland</option><option value="760">Syrian Arab Republic</option><option value="158">Taiwan</option><option value="762">Tajikistan</option><option value="834">Tanzania, United Republic of</option><option value="764">Thailand</option><option value="768">Togo</option><option value="772">Tokelau</option><option value="776">Tonga</option><option value="780">Trinidad and Tobago</option><option value="788">Tunisia</option><option value="792">Turkey</option><option value="795">Turkmenistan</option><option value="796">Turks and Caicos Islands</option><option value="798">Tuvalu</option><option value="800">Uganda</option><option value="804">Ukraine</option><option value="784">United Arab Emirates</option><option value="826">United Kingdom</option><option value="840">United States</option><option value="581">United States Minor Outlying Islands</option><option value="858">Uruguay</option><option value="860">Uzbekistan</option><option value="548">Vanuatu</option><option value="336">Vatican City State</option><option value="862">Venezuela, Bolivarian Republic of</option><option value="704">Viet Nam</option><option value="092">Virgin Islands, British</option><option value="850">Virgin Islands, U.S.</option><option value="876">Wallis and Futuna</option><option value="732">Western Sahara</option><option value="882">Western Samoa</option><option value="887">Yemen</option><option value="894">Zambia</option><option value="716">Zimbabwe</option>
 124+ </select>
 125+ </td>
 126+ </tr>
 127+ </table>
 128+ </div>
 129+ <!-- captcha -->
 130+ @captcha
 131+ <!-- end captcha -->
 132+ <div id="payflowpro_gateway-form-submit">
 133+ <div id="mw-donate-submit-button">
 134+ <input class="button-plain" value="Donate by Credit Card" type="submit" />
 135+ </div>
 136+ <div class="mw-donate-submessage" id="payflowpro_gateway-donate-submessage">
 137+ Your credit card will be securely processed.
 138+ </div>
 139+ </div>
 140+ <input type="hidden" value="@utm_source" name="utm_source" />
 141+ <input type="hidden" value="@utm_medium" name="utm_medium" />
 142+ <input type="hidden" value="@utm_campaign" name="utm_campaign" />
 143+ <input type="hidden" value="@language" name="language" />
 144+ <input type="hidden" value="@referrer" name="referrer" />
 145+ <input type="hidden" value="@comment" name="comment" />
 146+ <input type="hidden" value="@comment-option" name="comment-option" />
 147+ <input type="hidden" value="@email-opt" name="email-opt" />
 148+ <input type="hidden" value="CreditCard" name="process" />
 149+ <input type="hidden" value="processed" name="payment_method" />
 150+ <input type="hidden" value="@token" name="token" />
 151+ <input type="hidden" value="@orderid" name="orderid" />
 152+ <input type="hidden" value="@numAttempt" name="numAttempt" />
 153+ <input type="hidden" value="@contribution_tracking_id" name="contribution_tracking_id" />
 154+ <input type="hidden" value="@data_hash" name="data_hash" />
 155+ <input type="hidden" value="@action" name="action" />
 156+ <input type="hidden" value="@owa_session" name="owa_session" />
 157+ <input type="hidden" value="@owa_ref" name="owa_ref" />
 158+</form>
 159+<div class="payflow-cc-form-section" id="payflowpro_gateway-donate-addl-info"><div id="payflowpro_gateway-donate-addl-info-secure-logos"><p class=""><img src="/extensions/DonationInterface/payflowpro_gateway/includes/rapidssl_ssl_certificate-nonanimated.png"></p></div><div id="payflowpro_gateway-donate-addl-info-text"><p class=""><a href="http://wikimediafoundation.org/wiki/Ways_to_Give/en">Other ways to give</a></p><p class="">We do not store your credit card information, and your personal data is subject to our <a href="http://wikimediafoundation.org/wiki/Donor_Privacy_Policy">privacy policy</a>.</p><p class="">Questions or comments? Contact: <a href="mailto:donate@wikimedia.org">donate@wikimedia.org</a></p></div></div></td></tr></table><div class="printfooter">
 160+
 161+Retrieved from "<a href="https://payments.wikimedia.org/index.php/Special:PayflowProGateway">https://payments.wikimedia.org/index.php/Special:PayflowProGateway</a>"</div>
 162+
\ No newline at end of file
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php
@@ -0,0 +1,227 @@
 2+<?php
 3+
 4+class PayflowProGateway_Form_RapidHtml extends PayflowProGateway_Form {
 5+
 6+ /**
 7+ * Full path of HTML form to load
 8+ * @var string
 9+ */
 10+ protected $html_file_path = '';
 11+
 12+ /**
 13+ * Tokens used in HTML form for data replacement
 14+ *
 15+ * Note that these NEED to be in the same order as the variables in $data in
 16+ * order for str_replace to work as expected
 17+ * @var array
 18+ */
 19+ protected $data_tokens = array(
 20+ '@amount', // => $amount,
 21+ '@amountOther', // => $wgRequest->getText( 'amountOther' ),
 22+ '@emailAdd', //'email' => $wgRequest->getText( 'emailAdd' ),
 23+ '@fname', // => $wgRequest->getText( 'fname' ),
 24+ '@mname', // => $wgRequest->getText( 'mname' ),
 25+ '@lname', // => $wgRequest->getText( 'lname' ),
 26+ '@street', // => $wgRequest->getText( 'street' ),
 27+ '@city', // => $wgRequest->getText( 'city' ),
 28+ '@state', // => $wgRequest->getText( 'state' ),
 29+ '@zip', // => $wgRequest->getText( 'zip' ),
 30+ '@country', // => $wgRequest->getText( 'country' ),
 31+ '@card_num', // => str_replace( ' ', '', $wgRequest->getText( 'card_num' ) ),
 32+ '@card', // => $wgRequest->getText( 'card' ),
 33+ '@expiration', // => $wgRequest->getText( 'mos' ) . substr( $wgRequest->getText( 'year' ), 2, 2 ),
 34+ '@cvv', // => $wgRequest->getText( 'cvv' ),
 35+ '@currency_code', //'currency' => $wgRequest->getText( 'currency_code' ),
 36+ '@payment_method', // => $wgRequest->getText( 'payment_method' ),
 37+ '@orderid', // => $order_id,
 38+ '@numAttempt', // => $numAttempt,
 39+ '@referrer', // => ( $wgRequest->getVal( 'referrer' ) ) ? $wgRequest->getVal( 'referrer' ) : $wgRequest->getHeader( 'referer' ),
 40+ '@utm_source', // => self::getUtmSource(),
 41+ '@utm_medium', // => $wgRequest->getText( 'utm_medium' ),
 42+ '@utm_campaign', // => $wgRequest->getText( 'utm_campaign' ),
 43+ // try to honr the user-set language (uselang), otherwise the language set in the URL (language)
 44+ '@language', // => $wgRequest->getText( 'uselang', $wgRequest->getText( 'language' ) ),
 45+ '@comment-option', // => $wgRequest->getText( 'comment-option' ),
 46+ '@comment', // => $wgRequest->getText( 'comment' ),
 47+ '@email-opt', // => $wgRequest->getText( 'email-opt' ),
 48+ '@test_string', // => $wgRequest->getText( 'process' ), // for showing payflow string during testing
 49+ '@token', // => $token,
 50+ '@contribution_tracking_id', // => $wgRequest->getText( 'contribution_tracking_id' ),
 51+ '@data_hash', // => $wgRequest->getText( 'data_hash' ),
 52+ '@action', // => $wgRequest->getText( 'action' ),
 53+ '@gateway', // => 'payflowpro', // this may need to become dynamic in the future
 54+ '@owa_session', // => $wgRequest->getText( 'owa_session', null ),
 55+ '@owa_ref', // => $owa_ref,
 56+ );
 57+
 58+ /**
 59+ * Error field names used as tokens
 60+ * @var array
 61+ * @FIXME
 62+ * THERE IS A PROBLEM WITH 'general' - this is an array in the gateway body!!!
 63+ */
 64+ protected $error_tokens = array(
 65+ '#general',
 66+ '#retryMsg',
 67+ '#amount',
 68+ '#card_num',
 69+ '#card',
 70+ '#cvv',
 71+ '#fname',
 72+ '#lname',
 73+ '#city',
 74+ '#country',
 75+ '#street',
 76+ '#state',
 77+ '#zip',
 78+ '#emailAdd',
 79+ );
 80+
 81+ public function __construct( &$form_data, &$form_errors ) {
 82+ global $wgRequest;
 83+
 84+ parent::__construct( $form_data, $form_errors );
 85+
 86+ $this->loadValidateJs();
 87+
 88+ $this->set_html_file_path( $wgRequest->getText( 'ffname', 'default' ) );
 89+
 90+ // fix general form error messages so it's not an array of msgs
 91+ if ( count( $form_errors[ 'general' ] )) {
 92+ $general_errors = "";
 93+ foreach ( $form_errors[ 'general' ] as $general_error ) {
 94+ $general_errors .= "<p class='creditcard'>$general_error</p>";
 95+ }
 96+ $form_errors[ 'general' ] = $general_errors;
 97+ }
 98+ }
 99+
 100+ /**
 101+ * Return the HTML form with data added
 102+ */
 103+ public function getForm() {
 104+ $html = $this->load_html();
 105+ return $this->add_data( $html );
 106+ }
 107+
 108+ /**
 109+ * Load the HTML form from a file into a string
 110+ * @return string
 111+ */
 112+ public function load_html() {
 113+ return file_get_contents( $this->html_file_path );
 114+ }
 115+
 116+ /**
 117+ * Add data into the HTML form
 118+ *
 119+ * @param string $html Form with tokens as placehodlers for data
 120+ * @return string The HTML form with real data in it
 121+ */
 122+ public function add_data( $html ) {
 123+ // replace data
 124+ $form = str_replace( $this->data_tokens, $this->form_data, $html );
 125+
 126+ // replace errors
 127+ $form = str_replace( $this->error_tokens, $this->form_errors, $form );
 128+
 129+ // handle captcha
 130+ $form = str_replace( "@captcha", $this->getCaptchaHtml(), $form );
 131+
 132+ $form = $this->fix_dropdowns( $form );
 133+
 134+ return $form;
 135+ }
 136+
 137+ /**
 138+ * Set dropdowns to 'selected' where appropriate
 139+ *
 140+ * This is basically a hackish fix to make sure that dropdowns stay
 141+ * 'sticky' on form submit. This could no doubt be better.
 142+ * @param $html
 143+ * @return string
 144+ */
 145+ public function fix_dropdowns( $html ) {
 146+ // currency code
 147+ $start = strpos( $html, 'name="currency_code"' );
 148+ if ( $start ) {
 149+ $currency_code = $this->form_data[ 'currency' ];
 150+ $end = strpos( $html, '</select>', $start );
 151+ $str = substr( $html, $start, ( $end - $start ));
 152+ $str = str_replace( 'value="' . $currency_code . '"', 'value="' . $currency_code . '" selected="selected"', $str );
 153+ $html = substr_replace( $html, $str, $start, $end-$start );
 154+ }
 155+
 156+ // mos
 157+ $month = substr( $this->form_data[ 'expiration' ], 0, 2 );
 158+ $start = strpos( $html, 'name="mos"' );
 159+ if ( $start ) {
 160+ $end = strpos( $html, '</select>', $start );
 161+ $str = substr( $html, $start, ( $end - $start ));
 162+ $str = str_replace( 'value="' . $month . '"', 'value="' . $month . '" selected="selected"', $str );
 163+ $html = substr_replace( $html, $str, $start, $end-$start );
 164+ }
 165+
 166+ // year
 167+ $year = substr( $this->form_data[ 'expiration' ], 2, 2 );
 168+ $start = strpos( $html, 'name="year"' );
 169+ if ( $start ) {
 170+ $end = strpos( $html, '</select>', $start );
 171+ $str = substr( $html, $start, ( $end - $start ));
 172+ // dbl extra huge hack alert! note the '20' prefix...
 173+ $str = str_replace( 'value="20' . $year . '"', 'value="20' . $year . '" selected="selected"', $str );
 174+ $html = substr_replace( $html, $str, $start, $end-$start );
 175+ }
 176+
 177+ // state
 178+ $state = $this->form_data[ 'state' ];
 179+ $start = strpos( $html, 'name="state"' );
 180+ if ( $start ) {
 181+ $end = strpos( $html, '</select>', $start );
 182+ $str = substr( $html, $start, ( $end - $start ));
 183+ $str = str_replace( 'value="' . $state . '"', 'value="' . $state . '" selected="selected"', $str );
 184+ $html = substr_replace( $html, $str, $start, $end-$start );
 185+ }
 186+
 187+ //country
 188+ $country = $this->form_data[ 'country' ];
 189+ $start = strpos( $html, 'name="country"' );
 190+ if ( $start ) {
 191+ $end = strpos( $html, '</select>', $start );
 192+ $str = substr( $html, $start, ( $end - $start ));
 193+ $str = str_replace( 'value="' . $country . '"', 'value="' . $country . '" selected="selected"', $str );
 194+ $html = substr_replace( $html, $str, $start, $end-$start );
 195+ }
 196+
 197+ return $html;
 198+ }
 199+
 200+ /**
 201+ * Validate and set the path to the HTML file
 202+ *
 203+ * @param string $file_name
 204+ */
 205+ public function set_html_file_path( $file_name ) {
 206+ global $wgPayflowHtmlFormDir;
 207+
 208+ // Get the dirname - the "/." helps ensure we get a consistent path name with no trailing slash
 209+ $html_dir = dirname( $wgPayflowHtmlFormDir . "/." );
 210+
 211+ if ( !is_dir( $html_dir )) {
 212+ // throw some error
 213+ }
 214+
 215+ // make sure our file name is clean - strip extension and any other cruft like relpaths, dirs, etc
 216+ $file_info = pathinfo( $file_name );
 217+ $file_name = $file_info[ 'filename' ];
 218+
 219+ $full_path = $html_dir . '/' . $file_name . '.html';
 220+
 221+ if ( !file_exists( $full_path )) {
 222+ // throw some error or use default or both?
 223+ }
 224+
 225+ $this->html_file_path = $full_path;
 226+ }
 227+
 228+}
\ No newline at end of file
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
@@ -35,6 +35,7 @@
3636 $wgAutoloadClasses[ 'PayflowProGateway_Form_TwoStepTwoColumnLetterCA' ] = $dir . 'forms/TwoStepTwoColumnLetterCA.php';
3737 $wgAutoloadClasses[ 'PayflowProGateway_Form_TwoStepTwoColumnLetter2' ] = $dir . 'forms/TwoStepTwoColumnLetter2.php';
3838 $wgAutoloadClasses[ 'PayflowProGateway_Form_TwoStepTwoColumnLetter3' ] = $dir . 'forms/TwoStepTwoColumnLetter3.php';
 39+$wgAutoloadClasses[ 'PayflowProGateway_Form_RapidHtml' ] = $dir . 'forms/RapidHtml.php';
3940 $wgAutoloadClasses[ 'PayflowProGateway_Form_SingleColumn' ] = $dir . 'forms/SingleColumn.php';
4041 $wgExtensionMessagesFiles['PayflowProGateway'] = $dir . 'payflowpro_gateway.i18n.php';
4142 $wgExtensionMessagesFiles['PayflowProGatewayCountries'] = $dir . 'payflowpro_gateway.countries.i18n.php';
@@ -122,6 +123,12 @@
123124 $wgPayflowSMaxAge = 6000;
124125
125126 /**
 127+ * Directory for HTML forms (used by RapidHtml form class)
 128+ * @var string
 129+ */
 130+$wgPayflowHtmlFormDir = dirname( __FILE__ ) . "/forms/html";
 131+
 132+/**
126133 * Hooks required to interface with the donation extension (include <donate> on page)
127134 *
128135 * gwValue supplies the value of the form option, the name that appears on the form

Follow-up revisions

RevisionCommit summaryAuthorDate
r77503Followup r77119...awjrichards20:01, 30 November 2010

Comments

#Comment by RobLa (talk | contribs)   01:27, 25 November 2010

Generally speaking, it would be very helpful if there were a little documentation accompanying this. Based on my conversation with Tomasz, my understanding is that this enables a workflow whereby plain HTML forms in files can be dropped into a directory and used inside our infrastructure. It would be reassuring to know what the planned workflow for this is, and what steps are going to be taken to ensure that the people building the forms don't accidentally create exploits. Is it 100% dependent on human review, or are there some technical constraints on the type of HTML they can include?

The token substitution ("@foo") looks like it would make it really easy to unintentionally add an injection vector in the HTML. It would not appear that there's any escaping done on the data, which is pretty worrisome.

Looking through this, here's one thing that immediately jumps out:

+		if ( !is_dir( $html_dir )) {
+			// throw some error
+		}

Probably ought to pick which error to throw here, then actually throw it :)

Another concern is that this would appear to get the file name from $wgRequest. My PHP is somewhat rusty, so I don't know how much pathinfo() can be trusted to strip out all of the nefarious "../"-style tricks. It seems to catch the most obvious ones, but I'd want to be a little more sure than I currently am about this.

#Comment by MZMcBride (talk | contribs)   21:26, 28 November 2010

RobLa wrote:

Based on my conversation with Tomasz, my understanding is that this enables a workflow whereby plain HTML forms in files can be dropped into a directory and used inside our infrastructure.

That sounds a lot like HTMLets? Is there a difference?

#Comment by RobLa (talk | contribs)   05:57, 29 November 2010

Based on a very cursory investigation, I think one difference may be that this solution allows building forms that can be populated with form data from a failed submission (e.g. when one field is off, the form is presented again, with everything filled in as the user put it in so that they can make the minor correction rather that start over). Does HTMLet lends itself to that use case?

#Comment by Awjrichards (talk | contribs)   23:35, 29 November 2010

RobLa is correct - afaik, HTMLets does not support form 'stickiness'

#Comment by P858snake (talk | contribs)   23:54, 29 November 2010

Could you not add that to HTMLets then instead of recreating the cycle?

#Comment by Awjrichards (talk | contribs)   00:39, 30 November 2010

I could, but it would not meet the requirements for this feature ;)

We need a way for the fundraisers to quickly prototype fully functioning forms (in the sense that they function /exactly/ the same as our other credit card forms) without needing to know any PHP and preferably without directly editing any markup on our payment servers.

#Comment by MZMcBride (talk | contribs)   23:58, 29 November 2010

What Peachey88 said. I don't really understand how a specialized sub-extension is preferable here when a proper extension already exists and could be modified. (Admittedly I haven't been following the background on this, though.)

#Comment by Awjrichards (talk | contribs)   00:43, 30 November 2010

See my comment in response to Peachey88

Again, this code is intended to meet a fairly singular WMF need: rapid form prototyping (for production use) while preserving access restrictions to the payment cluster.

#Comment by MZMcBride (talk | contribs)   00:48, 30 November 2010

Commit summaries can be as long as you'd like them to be. ;-)

Nobody is going to complain if your summary is overly verbose and it will save you (and others) time and energy in the long run. :-)

#Comment by Awjrichards (talk | contribs)   01:04, 30 November 2010

Truth. Thanks for reminding me, it's dangerously easy to get lazy with commit messages when you're just trying to get something out there!

#Comment by MZMcBride (talk | contribs)   03:36, 30 November 2010

Thanks for the longer explanation below (#c11422). For the stats geeks, here are the top 100 longest commit messages for this repo: http://p.defau.lt/?4acj0Lij2AvmBlqCX5a0iQ

#Comment by Awjrichards (talk | contribs)   23:56, 29 November 2010

>Generally speaking, it would be very helpful if there were a little documentation accompanying this

In regards to the documentation, yes, I am working on it amidst the other high-priority fundraising items on my plate ATM. The general idea is that Kaldari will use this to try making some forms super quickly - he already knows everything he needs to in order to make use of this as-is.

>The token substitution ("@foo") looks like it would make it really easy to unintentionally add an injection vector in the HTML. It would not appear that there's any escaping done on the data, which is pretty worrisome.

Well, the data gets escaped in the Payflow Pro gateway code on form submission. As far as I can tell, this shouldn't introduce any new injection vector. The user is limited to only a pre-defined list of tokens to use for substitution which are also mapped to the data array that we use to pass escaped form data around internally. Maybe I'm missing something though - can you give me an example of what you had in mind?

> Probably ought to pick which error to throw here, then actually throw it :) Yes - actually doing something in those failed states is a very good idea ;) Before we start using this, I'll get this updated.

> My PHP is somewhat rusty, so I don't know how much pathinfo() can be trusted to strip out all of the nefarious "../"-style tricks. Yeah, you're totally right. pathinfo() is not enough. I'll come up with something safer.

#Comment by Awjrichards (talk | contribs)   23:57, 29 November 2010

Er sorry the line breaks got wonky on those last two points. Should read:

> Probably ought to pick which error to throw here, then actually throw it :)

Yes - actually doing something in those failed states is a very good idea ;) Before we start using this, I'll get this updated.

> My PHP is somewhat rusty, so I don't know how much pathinfo() can be trusted to strip out all of the nefarious "../"-style tricks.

Yeah, you're totally right. pathinfo() is not enough. I'll come up with something safer.

#Comment by RobLa-WMF (talk | contribs)   22:25, 30 November 2010

> In regards to the documentation, yes, I am working on it amidst the other high-priority fundraising items on my plate ATM.

Your comment (#22119) was all that I was really looking for (thanks!). I'd recommend copy/pasting that into README.txt and checking it in with the code and declaring victory for now.

#Comment by 😂 (talk | contribs)   21:17, 28 November 2010

This is vulnerable to XSS, since some of your data array comes straight from $wgRequest and is being spit out into HTML. All of that data array needs escaping before putting it into HTML.

It also relies on a lot of arbitrary naming of elements, eg: $start = strpos( $html, 'name="state"' );, which doesn't make this highly reusable. I also see hardcoded paths for images and to index.php, which also can cause problems when the fundraiser gets reengineered next year ;-)

Also doesn't look very i18n friendly.

#Comment by 😂 (talk | contribs)   21:20, 28 November 2010

(pressed enter too soon)

In general, I don't like this approach of using lots of raw HTML and substituting in the bits we want. Maybe it's personal preference.

I do, however, like Andrew's HTMLForm, and would like to see that become more versatile and thus widely used.

#Comment by RobLa (talk | contribs)   05:45, 29 November 2010

I suspect any solution that involves going all the way back to the drawing board risks not having anything useful for this year's fundraiser. If it's not necessary to start over in order to deploy a secure solution, that guidance would be useful. If, on the other hand, the current approach is beyond repair, that's useful to know as well.

#Comment by Awjrichards (talk | contribs)   00:27, 30 November 2010

> In general, I don't like this approach of using lots of raw HTML and substituting in the bits we want. Maybe it's personal preference.

Me neither, but again as a prototyping tool, I think it properly meets the fundraiser's needs.

> I do, however, like Andrew's HTMLForm, and would like to see that become more versatile and thus widely used.

We've looked into HTMLForm and liked what we saw, but in the interest of our specific needs and development/integration time, we decided to go this route.

#Comment by Awjrichards (talk | contribs)   00:29, 30 November 2010

Oh yeah, also we do not want to give edit access to the payment servers' wiki. Keeping this in audited flat-file templated HTML allows us to keep our security in place on the payments cluster.

#Comment by Awjrichards (talk | contribs)   00:25, 30 November 2010

>This is vulnerable to XSS, since some of your data array comes straight from $wgRequest and is being spit out into HTML. All of that data array needs escaping before putting it into HTML.

The only thing different about the data in this style form generation versus our other one is how we determine what HTML file to pull. The actual array of data gets built outside of this file in payflowpro_gateway.body.php I'm actually surprised this hasn't been brought up in previous code review of payflowpro_gateway.body.php (and that I hadn't previously thought of it...) But the $data array has been being populated in the same way since before I inherited the code. I will dig a little deeper into this, but I do not think this is a problem endemic to this particular code, but to the overall gateway code in general.

>It also relies on a lot of arbitrary naming of elements, eg: $start = strpos( $html, 'name="state"' );, which doesn't make this highly reusable.

Actually, this is not arbitrary. It is how the fields are named in our current donation forms. Since this was built as a way for the fundraisers to rapidly prototype forms in english and they have assured me that those fields will always be dropdowns and always be named the same way, this should not be a problem.

> Also doesn't look very i18n friendly.

Nope, it's absolutely horrid for i18n, but being i18n friendly was not a requirement for this. Again, this is just a prototyping tool for the fundraisers - if they build a form and decide to go with it, we will convert it to be built the same way we build all of the other form variants, making it i18n-friendly

#Comment by Awjrichards (talk | contribs)   01:00, 30 November 2010

Just to give a little background on this code for those of you who don't know:

The fundraising team asked the tech team for a way to very quickly prototype english-only credit card forms so they can do very rapid iterative live testing to see, with real world usage data, how to improve the forms. This is a very high priority feature request that needs to be completed ASAP.

The current way we develop our credit card forms does /not/ support this - partly for security, partly for i18n and partly because what we have in place now existed long before this ever became a requirement. We thought about using or devising some solution that would allow for easy form creation in wiki markup (eg using the HTMLForm extension), but one of our tech (and incidentally PCI compliance) requirements is to keep access to the payment servers highly restricted. So, rather than completely change how we build forms, allow for others to build forms, process forms, etc. in the middle of the fundraiser, we devised this scheme: a super-lightweight, flat-file html approach with highly restrictive templating tokens/placeholders for reinserting data on form submission failure (form stickiness).

Yes, this means that forms generated in this way will not be localizable in the normal WMF paradigm - but that's ok. If a form is deemed to be 'successful' by the fundraisers, it will be coded the same way we've been building the credit card forms, allowing it to be localized.

Yes, this means that there is the possibility of introducing a security vulnerability by including a flat HTML file. But that's ok too - the fundraisers will pass the flat files to the tech team for security audit/review before being put into production.

Yes, this is fairly one-off, WMF-specific feature. So yes, that means there are some ugly, static things in the code. And yes this means that we ultimately may be reinventing the wheel in some ways - but for our needs and purposes right now, that's ok too.

So, I'm going to clean up some of the potential security issues in the code. But in the mean time, if someone wants to build something that still meets the requirements but does so more elegantly, please do :)

#Comment by Awjrichards (talk | contribs)   21:24, 30 November 2010

All of the outstanding issues have been resolved as of r77503

Status & tagging log