Changeset 16105
- Timestamp:
- Jun 27, 2012, 11:10:50 PM (12 years ago)
- Location:
- extensions/Subscribe_to_comments
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Subscribe_to_comments/include/functions.inc.php
r15656 r16105 690 690 * @return: bool 691 691 */ 692 function is_valid_email($mail_address) 693 { 694 if (version_compare(PHP_VERSION, '5.2.0') >= 0) 695 { 696 return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false; 697 } 698 else 699 { 700 $atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; // before arobase 701 $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 702 $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 703 704 if (!preg_match($regex, $mail_address)) return false; 705 return true; 692 if (!function_exists('is_valid_email')) 693 { 694 function is_valid_email($mail_address) 695 { 696 if (version_compare(PHP_VERSION, '5.2.0') >= 0) 697 { 698 return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false; 699 } 700 else 701 { 702 $atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; // before arobase 703 $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 704 $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 705 706 if (!preg_match($regex, $mail_address)) return false; 707 return true; 708 } 706 709 } 707 710 } -
extensions/Subscribe_to_comments/include/subscribe_to_comments.inc.php
r15641 r16105 373 373 374 374 /** 375 * delete subscriptions to deleted images or categories 376 */ 377 function stc_delete_elements($ids) 378 { 379 $query = ' 380 DELETE FROM '.SUBSCRIBE_TO_TABLE.' 381 WHERE element_id IN ('.implode(',', $ids).') 382 '; 383 pwg_query($query); 384 } 385 386 387 /** 375 388 * add link to management page for registered users 376 389 */ -
extensions/Subscribe_to_comments/main.inc.php
r15641 r16105 42 42 add_event_handler('loc_end_section_init', 'stc_detect_section'); 43 43 add_event_handler('loc_begin_page_header', 'stc_load_section'); 44 45 // items deletion 46 add_event_handler('begin_delete_elements', 'stc_delete_elements'); 47 add_event_handler('delete_categories', 'stc_delete_elements'); 44 48 45 49 // profile link
Note: See TracChangeset
for help on using the changeset viewer.