Added another size limit check to Job::toString
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 9 Oct 2014 00:15:05 +0000 (17:15 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 9 Oct 2014 00:15:05 +0000 (17:15 -0700)
Change-Id: I5a6e94eb98769b33d0ea44273d0eee8ee669dd17

includes/jobqueue/Job.php

index d89c5d2..e049303 100644 (file)
@@ -315,7 +315,7 @@ abstract class Job implements IJobSpecification {
                                                        break;
                                                }
                                        }
-                                       if ( $filteredValue ) {
+                                       if ( $filteredValue && count( $filteredValue ) < 10 ) {
                                                $value = FormatJson::encode( $filteredValue );
                                        } else {
                                                $value = "array(" . count( $value ) . ")";
@@ -329,15 +329,15 @@ abstract class Job implements IJobSpecification {
                }
 
                if ( is_object( $this->title ) ) {
-                       $s = "{$this->command} " . $this->title->getPrefixedDBkey();
+                       $s = "{$this->command} {$this->title->getPrefixedDBkey()}";
                        if ( $paramString !== '' ) {
-                               $s .= ' ' . $paramString;
+                               $s .= " $paramString";
                        }
-
-                       return $s;
                } else {
-                       return "{$this->command} $paramString";
+                       $s = "{$this->command} $paramString";
                }
+
+               return $s;
        }
 
        protected function setLastError( $error ) {