Commits

Phil Sturgeon committed 32dbbdf

Reverted regex validation while we re-think the implementation, and added ->input->is_cli_request();

  • Participants
  • Parent commits 446d914

Comments (0)

Files changed (2)

File system/core/Input.php

 	}
 
 	// --------------------------------------------------------------------
-	
+
 	/**
 	 * Is ajax Request?
 	 *
 	 * Test to see if a request contains the HTTP_X_REQUESTED_WITH header
 	 *
-	 * @return 	boolean 	
+	 * @return 	boolean
 	 */
 	public function is_ajax_request()
 	{
 		return ($this->server('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest');
 	}
 
+	// --------------------------------------------------------------------
+
+	/**
+	 * Is cli Request?
+	 *
+	 * Test to see if a request was made from the command line
+	 *
+	 * @return 	boolean
+	 */
+	public function is_cli_request()
+	{
+		return (bool) defined('STDIN');
+	}
+
 }
 // END Input class
 

File system/libraries/Form_validation.php

 		}
 
 		$this->_error_messages = array_merge($this->_error_messages, $lang);
-		
+
 		return $this;
 	}
 
 	{
 		$this->_error_prefix = $prefix;
 		$this->_error_suffix = $suffix;
-		
+
 		return $this;
 	}
 
 				}
 			}
 
-			preg_match_all('/([a-zA-Z_-]*(\[.*\])?)\|?/i', $row['rules'], $matches);
-
-			$rules = $matches[1];
-			array_pop($rules);
-			unset($matches);
-
-			$this->_execute($row, $rules, $this->_field_data[$field]['postdata']);
+			$this->_execute($row, explode('|', $row['rules']), $this->_field_data[$field]['postdata']);
 		}
 
 		// Did we end up with any errors?
 		{
 			return array_shift($this->_field_data[$field]['postdata']);
 		}
-		
+
 		return $this->_field_data[$field]['postdata'];
 	}