Add CollationFa
[lhc/web/wiklou.git] / includes / media / XMPValidate.php
index 55e8ce7..fe47f47 100644 (file)
@@ -70,7 +70,7 @@ class XMPValidate implements LoggerAwareInterface {
                        return;
                }
                if ( $val !== 'True' && $val !== 'False' ) {
-                       $this->debug->info( __METHOD__ . " Expected True or False but got $val" );
+                       $this->logger->info( __METHOD__ . " Expected True or False but got $val" );
                        $val = null;
                }
        }
@@ -167,7 +167,7 @@ class XMPValidate implements LoggerAwareInterface {
                        return;
                }
 
-               //check if its in a numeric range
+               // check if its in a numeric range
                $inRange = false;
                if ( isset( $info['rangeLow'] )
                        && isset( $info['rangeHigh'] )
@@ -218,8 +218,9 @@ class XMPValidate implements LoggerAwareInterface {
         *
         * This is just a naive check to make sure it somewhat looks like a lang code.
         *
-        * @see rfc 3066
-        * @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf page 30 (section 8.2.2.5)
+        * @see BCP 47
+        * @see https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/
+        *      XMP%20SDK%20Release%20cc-2014-12/XMPSpecificationPart1.pdf page 22 (section 8.2.2.4)
         *
         * @param array $info Information about current property
         * @param mixed &$val Current value to validate
@@ -231,7 +232,7 @@ class XMPValidate implements LoggerAwareInterface {
                        return;
                }
                if ( !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $val ) ) {
-                       //this is a rather naive check.
+                       // this is a rather naive check.
                        $this->logger->info( __METHOD__ . " Expected Lang code but got $val" );
                        $val = null;
                }
@@ -259,7 +260,7 @@ class XMPValidate implements LoggerAwareInterface {
                        // this only validates standalone properties, not arrays, etc
                        return;
                }
-               $res = array();
+               $res = [];
                // @codingStandardsIgnoreStart Long line that cannot be broken
                if ( !preg_match(
                        /* ahh! scary regex... */
@@ -292,8 +293,8 @@ class XMPValidate implements LoggerAwareInterface {
                                return;
                        }
 
-                       if ( !isset( $res[4] ) ) { //hour
-                               //just have the year month day (if that)
+                       if ( !isset( $res[4] ) ) { // hour
+                               // just have the year month day (if that)
                                $val = $res[1];
                                if ( isset( $res[2] ) ) {
                                        $val .= ':' . $res[2];
@@ -306,7 +307,7 @@ class XMPValidate implements LoggerAwareInterface {
                        }
 
                        if ( !isset( $res[7] ) || $res[7] === 'Z' ) {
-                               //if hour is set, then minute must also be or regex above will fail.
+                               // if hour is set, then minute must also be or regex above will fail.
                                $val = $res[1] . ':' . $res[2] . ':' . $res[3]
                                        . ' ' . $res[4] . ':' . $res[5];
                                if ( isset( $res[6] ) && $res[6] !== '' ) {
@@ -360,7 +361,7 @@ class XMPValidate implements LoggerAwareInterface {
                        return;
                }
 
-               $m = array();
+               $m = [];
                if ( preg_match(
                        '/(\d{1,3}),(\d{1,2}),(\d{1,2})([NWSE])/D',
                        $val, $m )