Code Duplication    Length = 4-5 lines in 2 locations

classes/class-tours.php 2 locations

@@ 784-787 (lines=4) @@
781
	 */
782
	public function set_price($data,$id) {
783
	    //Price
784
		if(isset($data['price']) && ''!== $data['price']){
785
            $price = preg_replace("/[^0-9,.]/", "", $data['price']);
786
            $this->save_custom_field($price,'price',$id);
787
		}
788
789
		//Price includes
790
		if(isset($data['price_includes']) && ''!== $data['price_includes']){
@@ 805-809 (lines=5) @@
802
	 * Set the duration
803
	 */
804
	public function set_duration($data,$id) {
805
		if(isset($data['days']) && !empty($data['days'])){
806
			$price = $data['days'];
807
			$price = preg_replace("/[^0-9,.]/", "", $price);
808
			$this->save_custom_field($price,'duration',$id);
809
		}
810
	}
811
812
	/**