]> granicus.if.org Git - php/commitdiff
Fix build on ICU < 53
authorAnatol Belski <ab@php.net>
Sat, 21 Oct 2017 15:37:51 +0000 (17:37 +0200)
committerAnatol Belski <ab@php.net>
Sat, 21 Oct 2017 15:37:51 +0000 (17:37 +0200)
ext/intl/spoofchecker/spoofchecker_main.c
ext/intl/tests/spoofchecker_007.phpt

index 7777c0a10d35b5ff89e6dcfd5223cfb651763369..c063e656a499dee6659615f21c16ee1800ed61ca 100644 (file)
@@ -149,7 +149,9 @@ PHP_METHOD(Spoofchecker, setRestrictionLevel)
        SPOOFCHECKER_METHOD_FETCH_OBJECT;
 
        if (USPOOF_ASCII != level &&
+#if U_ICU_VERSION_MAJOR_NUM >= 53
                        USPOOF_SINGLE_SCRIPT_RESTRICTIVE != level &&
+#endif
                        USPOOF_HIGHLY_RESTRICTIVE != level &&
                        USPOOF_MODERATELY_RESTRICTIVE != level &&
                        USPOOF_MINIMALLY_RESTRICTIVE != level &&
index 405094dfcca1d12ab4cc5cfaec05df3e5acf71e6..1dfdcc98ce12e186a9e36aae86c875e4c08cac71 100644 (file)
@@ -2,6 +2,12 @@
 spoofchecker with restriction level
 --SKIPIF--
 <?php if(!extension_loaded('intl') || !class_exists("Spoofchecker")) print 'skip'; ?>
+<?php
+       $r = new ReflectionClass("SpoofChecker");
+       if (false === $r->getConstant("SINGLE_SCRIPT_RESTRICTIVE")) {
+               die("Incompatible ICU version");
+       }
+?>
 --FILE--
 <?php