* (wpFormIdentifier).
*
* @param WebRequest $request
- * @return boolean
+ * @return bool
*/
protected function isSubmitAttempt( WebRequest $request ) {
return $request->getCheck( 'wpEditToken' ) || $request->getCheck( 'wpFormIdentifier' );
$this->mDir = $params['dir'];
}
- $validName = Sanitizer::escapeId( $this->mName );
- $validName = str_replace( [ '.5B', '.5D' ], [ '[', ']' ], $validName );
+ $validName = urlencode( $this->mName );
+ $validName = str_replace( [ '%5B', '%5D' ], [ '[', ']' ], $validName );
if ( $this->mName != $validName && !isset( $params['nodata'] ) ) {
throw new MWException( "Invalid name '{$this->mName}' passed to " . __METHOD__ );
}
if ( isset( $params['id'] ) ) {
$id = $params['id'];
- $validId = Sanitizer::escapeId( $id );
+ $validId = urlencode( $id );
if ( $id != $validId ) {
throw new MWException( "Invalid id '$id' passed to " . __METHOD__ );
}
/**
- * Returns the attributes required for the tooltip and accesskey.
+ * Returns the attributes required for the tooltip and accesskey, for Html::element() etc.
*
* @return array Attributes
*/
return Linker::tooltipAndAccesskeyAttribs( $this->mParams['tooltip'] );
}
+ /**
+ * Returns the attributes required for the tooltip and accesskey, for OOUI widgets' config.
+ *
+ * @return array Attributes
+ */
+ public function getTooltipAndAccessKeyOOUI() {
+ if ( empty( $this->mParams['tooltip'] ) ) {
+ return [];
+ }
+
+ return [
+ 'title' => Linker::titleAttrib( $this->mParams['tooltip'] ),
+ 'accessKey' => Linker::accesskey( $this->mParams['tooltip'] ),
+ ];
+ }
+
/**
* Returns the given attributes from the parameters
*
* Whether this field requires the user agent to have JavaScript enabled for the client-side HTML5
* form validation to work correctly.
*
- * @return boolean
+ * @return bool
* @since 1.29
*/
public function needsJSForHtml5FormValidation() {