Ignore:
Timestamp:
09/24/2009 01:25:39 AM (3 years ago)
Author:
Acinonyx
Message:

[awmn] Add zone name validation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/awmn/globals/functions.php

    r198 r203  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    312313} 
    313314 
     315function validate_zone($name) { 
     316        $name = str_replace("_", "-", $name); 
     317        $name = strtolower($name); 
     318        if (preg_match('/^((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)*([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])|)$/', $name) == 0) return NULL; 
     319        return $name; 
     320} 
     321 
    314322function validate_name_ns($name, $node) { 
    315323        global $db; 
Note: See TracChangeset for help on using the changeset viewer.