Пример #1
0
 public static function validatePermalink($permalink_array, $cid = null, $type = null, $lid = null)
 {
     $validated = true;
     if (is_array($permalink_array)) {
         foreach ($permalink_array as $permalink) {
             if (preg_match('/^[a-z0-9_-]+$/iD', $permalink) !== 1) {
                 $validated = false;
             }
             if (lC_Categories_Admin::getPermalinkCount($permalink, $cid, $type, $lid) > 0) {
                 $validated = false;
             }
         }
     } else {
         if (preg_match('/^[a-z0-9_-]+$/iD', $permalink) !== 1) {
             $validated = false;
         }
         if (lC_Categories_Admin::getPermalinkCount($permalink, $cid, $type, $lid) > 0) {
             $validated = false;
         }
     }
     return $validated;
 }