Serious back-end validation needed in next release
Here are my suggestion for an improvement.
VERSION: ClassiPress 3.0.5
step-functions.php - line 695
. (such as submitting blank form)
ClassiPress did send email to Admin and the ad poster regarding the new (false) ad submission. All related operation when creating an ad listing is carried out; Although the returned post_id==0 (refer step-functions.php
- starting line 695 to 745)
1. Stopping unnecessary execution of code if returned post_id==0
add exception on step-functions.php
- after line 695
if( $post_id == 0 ) return 0;
add exception on step3.php
- after line 43
if( $post_id != 0 ):
// just before removing the temp session option from the database : line 90
Note: You may add custom error message saying that the submission didn't happen. Because post_id==0.
2. Prevent user from submitting the form (if the form is not validated)
needs a lot of improvement on validation. It seems that even if the fields value are null, the process seems to validate and allow submission to proceed. This should not happen. (I leave this to ClassiPress development team for next release)
For an express alternative solution, you can use the following:
Replace the submit button like so: step1.php
- line 98:
<script>document.write('<input type="submit" name="step1" id="step1" class="btn_orange" value="<?php _e('Continue ››','appthemes'); ?>" />');</script>
Hope this info helps.