For r106521/r106865, wrap long example description strings
authorSam Reed <reedy@users.mediawiki.org>
Tue, 20 Dec 2011 21:37:51 +0000 (21:37 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 20 Dec 2011 21:37:51 +0000 (21:37 +0000)
Follows up r106439

includes/api/ApiBase.php

index efbf1c0..920f114 100644 (file)
@@ -280,11 +280,11 @@ abstract class ApiBase extends ContextSource {
                                                $msg .= "  $v\n";
                                        } else {
                                                if ( is_array( $v ) ) {
-                                                       $msg .= implode( "\n", array_map( array( $this, 'indentExampleText' ), $v ) );
+                                                       $msgExample = implode( "\n", array_map( array( $this, 'indentExampleText' ), $v ) );
                                                } else {
-                                                       $msg .= "  $v";
+                                                       $msgExample = "  $v";
                                                }
-                                               $msg .= "\n    $k";
+                                               $msg .= wordwrap( $msgExample, 100, "\n" ) . "\n    $k";
                                        }
                                }
                        }