Disallow the creation of articles with titles wich are bigger than the size of cur_title in the database. Please review this code, it is working but I am not sure if it is safe :)
$t->mDbkeyform = str_replace( " ", "_", $s );
if( $t->secureAndSplit() ) {
+
+ # check that lenght of title is < cur_title size
+ $sql = "SHOW COLUMNS FROM cur LIKE \"cur_title\";";
+ $cur_title_object = wfFetchObject(wfQuery( $sql, DB_READ ));
+
+ preg_match( "/\((.*)\)/", $cur_title_object->Type, $cur_title_size);
+
+ if (strlen($t->mDbkeyform) > $cur_title_size[1] ) {
+ return NULL;
+ }
+
return $t;
} else {
return NULL;
# Initial capital letter
if( $this->mInterwiki == "") $t = $wgLang->ucfirst( $r );
-
+
# Fill fields
$this->mDbkeyform = $t;
$this->mUrlform = wfUrlencode( $t );