"PHP" / Говнокод #18247 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
// Check if the subnet begins with $startip and ends before $endip
if (($targetsub_min == $startip) && ip_less_than($targetsub_max, $endip)) {
	break;
}

// Check if the subnet ends at $endip and starts after $startip
if (ip_greater_than($targetsub_min, $startip) && ($targetsub_max == $endip)) {
	break;
}

// Check if the subnet is between $startip and $endip
if (ip_greater_than($targetsub_min, $startip) && ip_less_than($targetsub_max, $endip)) {
	break;
}

Коль уж старые посты потерлись, принесу это говно снова. Я тогда самое главное забыл. Теперь эти пидорасы не оправдаются ущербностью PHP.

https://github.com/pfsense/pfsense/blob/master/etc/inc/util.inc#L542-L555

Запостил: superhacker777 superhacker777, (Updated )

Комментарии (1) RSS

  • $ python3
    Python 3.4.1 (default, May 23 2014, 17:48:28) [GCC] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from ipaddress import ip_address as IP
    >>> IP('127.0.0.0') < IP('127.0.0.1') < IP('127.0.0.255')
    True
    >>> IP('127.0.0.0') < IP('8.8.8.8') < IP('127.0.0.255')
    False

    Гы-гы.
    Ответить

Добавить комментарий

Семь раз отмерь — один отрежь, guest!

    А не использовать ли нам bbcode?


    8