fix some spacing
[lhc/web/wiklou.git] / includes / media / XMPValidate.php
index 5ce3c00..deb4448 100644 (file)
@@ -95,8 +95,8 @@ class XMPValidate {
                        return;
                }
                if ( !preg_match( '/^[-+]?\d*(?:\.?\d*)$/D', $val )
-                       || !is_numeric($val)
-                ) {
+                       || !is_numeric( $val )
+               ) {
                        wfDebugLog( 'XMP', __METHOD__ . " Expected rating but got $val" );
                        $val = null;
                        return;
@@ -106,12 +106,12 @@ class XMPValidate {
                                // We do < 0 here instead of < -1 here, since
                                // the values between 0 and -1 are also illegal
                                // as -1 is meant as a special reject rating.
-                               wfDebugLog( 'XMP', __METHOD__ . " Rating too low, setting to -1 (Rejected)");
+                               wfDebugLog( 'XMP', __METHOD__ . " Rating too low, setting to -1 (Rejected)" );
                                $val = '-1';
                                return;
                        }
                        if ( $nVal > 5 ) {
-                               wfDebugLog( 'XMP', __METHOD__ . " Rating too high, setting to 5");
+                               wfDebugLog( 'XMP', __METHOD__ . " Rating too high, setting to 5" );
                                $val = '5';
                                return;
                        }
@@ -153,7 +153,7 @@ class XMPValidate {
 
                //check if its in a numeric range
                $inRange = false;
-               if ( isset( $info['rangeLow'] ) 
+               if ( isset( $info['rangeLow'] )
                        && isset( $info['rangeHigh'] )
                        && is_numeric( $val )
                        && ( intval( $val ) <= $info['rangeHigh'] )
@@ -247,8 +247,8 @@ class XMPValidate {
                $res = array();
                if ( !preg_match(
                        /* ahh! scary regex... */
-                       '/^([0-3]\d{3})(?:-([01]\d)(?:-([0-3]\d)(?:T([0-2]\d):([0-6]\d)(?::([0-6]\d)(?:\.\d+)?)?([-+]\d{2}:\d{2}|Z)?)?)?)?$/D'
-                       , $val, $res)
+                       '/^([0-3]\d{3})(?:-([01]\d)(?:-([0-3]\d)(?:T([0-2]\d):([0-6]\d)(?::([0-6]\d)(?:\.\d+)?)?([-+]\d{2}:\d{2}|Z)?)?)?)?$/D',
+                       $val, $res )
                ) {
                        wfDebugLog( 'XMP', __METHOD__ . " Expected date but got $val" );
                        $val = null;
@@ -295,7 +295,6 @@ class XMPValidate {
                                return;
                        }
 
-
                        // Extra check for empty string necessary due to TZ but no second case.
                        $stripSeconds = false;
                        if ( !isset( $res[6] ) || $res[6] === '' ) {
@@ -342,7 +341,7 @@ class XMPValidate {
                }
 
                $m = array();
-               if ( preg_match( 
+               if ( preg_match(
                        '/(\d{1,3}),(\d{1,2}),(\d{1,2})([NWSE])/D',
                        $val, $m )
                ) {
@@ -354,7 +353,7 @@ class XMPValidate {
                        }
                        $val = $coord;
                        return;
-               } elseif ( preg_match( 
+               } elseif ( preg_match(
                        '/(\d{1,3}),(\d{1,2}(?:.\d*)?)([NWSE])/D',
                        $val, $m )
                ) {
@@ -367,7 +366,7 @@ class XMPValidate {
                        return;
 
                } else {
-                       wfDebugLog( 'XMP', __METHOD__ 
+                       wfDebugLog( 'XMP', __METHOD__
                                . " Expected GPSCoordinate, but got $val." );
                        $val = null;
                        return;