当前位置: 首页>>代码示例>>PHP>>正文


PHP Sanitizer::encodeAttribute方法代码示例

本文整理汇总了PHP中Sanitizer::encodeAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP Sanitizer::encodeAttribute方法的具体用法?PHP Sanitizer::encodeAttribute怎么用?PHP Sanitizer::encodeAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sanitizer的用法示例。


在下文中一共展示了Sanitizer::encodeAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: convertDataToAttributes

 public static function convertDataToAttributes($data)
 {
     // get ID of current CK instance
     $instance = RTE::getInstanceId();
     // properly encode JSON
     $encoded = RTEReverseParser::encodeRTEData($data);
     $encoded = Sanitizer::encodeAttribute($encoded);
     return " data-rte-meta=\"{$encoded}\" data-rte-instance=\"{$instance}\" ";
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:RTEData.class.php

示例2: expandAttributes

	/**
	 * Given an array of ('attributename' => 'value'), it generates the code
	 * to set the XML attributes : attributename="value".
	 * The values are passed to Sanitizer::encodeAttribute.
	 * Return null if no attributes given.
	 * @param array $attribs of attributes for an XML element
	 * @throws MWException
	 * @return null|string
	 */
	public static function expandAttributes( $attribs ) {
		$out = '';
		if ( is_null( $attribs ) ) {
			return null;
		} elseif ( is_array( $attribs ) ) {
			foreach ( $attribs as $name => $val ) {
				$out .= " {$name}=\"" . Sanitizer::encodeAttribute( $val ) . '"';
			}
			return $out;
		} else {
			throw new MWException( 'Expected attribute array, got something else in ' . __METHOD__ );
		}
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:22,代码来源:Xml.php

示例3: index

 public function index()
 {
     wfProfileIn(__METHOD__);
     if (!$this->getUser()->isAllowed('coppatool')) {
         wfProfileOut(__METHOD__);
         $this->displayRestrictionError();
         return false;
     }
     $this->specialPage->setHeaders();
     $this->response->setTemplateEngine(WikiaResponse::TEMPLATE_ENGINE_MUSTACHE);
     $this->userName = trim($this->getVal('username', $this->getPar()));
     $this->isIP = false;
     $this->validUser = false;
     if (IP::isIPAddress($this->userName)) {
         $this->userName = IP::sanitizeIP($this->userName);
         $this->isIP = true;
         $this->validUser = true;
     } else {
         $userObj = User::newFromName($this->userName);
         if (!$userObj || $userObj->getId() === 0) {
             $this->validUser = false;
         } else {
             $this->userName = $userObj->getName();
             $this->validUser = true;
         }
     }
     $this->userForm = $this->app->renderView('WikiaStyleGuideForm', 'index', ['form' => ['isInvalid' => $this->validUser || $this->userName === '' ? false : true, 'errorMsg' => $this->validUser || $this->userName === '' ? '' : $this->msg('coppatool-nosuchuser', $this->userName)->escaped(), 'inputs' => [['type' => 'text', 'name' => 'username', 'isRequired' => true, 'label' => $this->msg('coppatool-label-username')->escaped(), 'value' => Sanitizer::encodeAttribute($this->userName)], ['type' => 'submit', 'value' => $this->msg('coppatool-submit')->escaped()]], 'method' => 'GET', 'action' => $this->getTitle()->getLocalUrl()]]);
     if ($this->validUser) {
         $this->getOutput()->addModules('ext.coppaTool');
         $this->buttons = [];
         $this->blankImgUrl = wfBlankImgUrl();
         $this->formHeading = $this->msg('coppatool-form-header')->escaped();
         if (!$this->isIP) {
             $this->buttons[] = ['buttonAction' => 'disable-account', 'buttonLink' => Html::element('a', ['href' => '#'], $this->msg('coppatool-disable')->escaped()), 'done' => $userObj->getGlobalFlag('disabled', false)];
             $this->buttons[] = ['buttonAction' => 'blank-profile', 'buttonLink' => Html::element('a', ['href' => '#'], $this->msg('coppatool-blank-user-profile')->escaped())];
             $this->buttons[] = ['buttonAction' => 'delete-userpages', 'buttonLink' => Html::element('a', ['href' => '#'], $this->msg('coppatool-delete-user-pages')->escaped())];
             $this->buttons[] = ['buttonAction' => 'coppa-imagereview', 'buttonLink' => Linker::link(Title::newFromText('CoppaImageReview', NS_SPECIAL), $this->msg('coppatool-imagereview')->escaped(), ['target' => '_blank'], ['username' => $this->userName], ['known', 'noclasses'])];
         } else {
             $this->buttons[] = ['buttonAction' => 'phalanx-ip', 'buttonLink' => Linker::link(Title::newFromText('Phalanx', NS_SPECIAL), $this->msg('coppatool-phalanx-ip')->escaped(), ['target' => '_blank'], ['type' => Phalanx::TYPE_USER, 'wpPhalanxCheckBlocker' => $this->userName, 'target' => $this->userName], ['known', 'noclasses'])];
             $this->buttons[] = ['buttonAction' => 'rename-ip', 'buttonLink' => Html::element('a', ['href' => '#'], $this->msg('coppatool-rename-ip')->escaped())];
         }
     }
     wfProfileOut(__METHOD__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:44,代码来源:CoppaToolSpecialController.class.php

示例4: element

 /**
  * Format an XML element with given attributes and, optionally, text content.
  * Element and attribute names are assumed to be ready for literal inclusion.
  * Strings are assumed to not contain XML-illegal characters; special
  * characters (<, >, &) are escaped but illegals are not touched.
  *
  * @param $element String:
  * @param $attribs Array: Name=>value pairs. Values will be escaped.
  * @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default)
  * @return string
  */
 public static function element($element, $attribs = null, $contents = '')
 {
     $out = '<' . $element;
     if (!is_null($attribs)) {
         foreach ($attribs as $name => $val) {
             $out .= ' ' . $name . '="' . Sanitizer::encodeAttribute($val) . '"';
         }
     }
     if (is_null($contents)) {
         $out .= '>';
     } else {
         if ($contents === '') {
             $out .= ' />';
         } else {
             $out .= '>' . htmlspecialchars($contents) . "</{$element}>";
         }
     }
     return $out;
 }
开发者ID:mediawiki-extensions,项目名称:bizzwiki,代码行数:30,代码来源:Xml.php

示例5: recXmlPrint

 /**
  * This method takes an array and converts it to XML.
  * There are several noteworthy cases:
  *
  *  If array contains a key '_element', then the code assumes that ALL other keys are not important and replaces them with the value['_element'].
  *	Example:	name='root',  value = array( '_element'=>'page', 'x', 'y', 'z') creates <root>  <page>x</page>  <page>y</page>  <page>z</page> </root>
  *
  *  If any of the array's element key is '*', then the code treats all other key->value pairs as attributes, and the value['*'] as the element's content.
  *	Example:	name='root',  value = array( '*'=>'text', 'lang'=>'en', 'id'=>10)   creates  <root lang='en' id='10'>text</root>
  *
  * If neither key is found, all keys become element names, and values become element content.
  * The method is recursive, so the same rules apply to any sub-arrays.
  *
  * @param $elemName
  * @param $elemValue
  * @param $indent
  * @param $doublequote bool
  *
  * @return string
  */
 public static function recXmlPrint($elemName, $elemValue, $indent, $doublequote = false)
 {
     $retval = '';
     if (!is_null($indent)) {
         $indent += 2;
         $indstr = "\n" . str_repeat(' ', $indent);
     } else {
         $indstr = '';
     }
     $elemName = str_replace(' ', '_', $elemName);
     switch (gettype($elemValue)) {
         case 'array':
             if (isset($elemValue['*'])) {
                 $subElemContent = $elemValue['*'];
                 if ($doublequote) {
                     $subElemContent = Sanitizer::encodeAttribute($subElemContent);
                 }
                 unset($elemValue['*']);
                 // Add xml:space="preserve" to the
                 // element so XML parsers will leave
                 // whitespace in the content alone
                 $elemValue['xml:space'] = 'preserve';
             } else {
                 $subElemContent = null;
             }
             if (isset($elemValue['_element'])) {
                 $subElemIndName = $elemValue['_element'];
                 unset($elemValue['_element']);
             } else {
                 $subElemIndName = null;
             }
             $indElements = array();
             $subElements = array();
             foreach ($elemValue as $subElemId => &$subElemValue) {
                 if (is_string($subElemValue) && $doublequote) {
                     $subElemValue = Sanitizer::encodeAttribute($subElemValue);
                 }
                 if (gettype($subElemId) === 'integer') {
                     $indElements[] = $subElemValue;
                     unset($elemValue[$subElemId]);
                 } elseif (is_array($subElemValue)) {
                     $subElements[$subElemId] = $subElemValue;
                     unset($elemValue[$subElemId]);
                 }
             }
             if (is_null($subElemIndName) && count($indElements)) {
                 ApiBase::dieDebug(__METHOD__, "({$elemName}, ...) has integer keys without _element value. Use ApiResult::setIndexedTagName().");
             }
             if (count($subElements) && count($indElements) && !is_null($subElemContent)) {
                 ApiBase::dieDebug(__METHOD__, "({$elemName}, ...) has content and subelements");
             }
             if (!is_null($subElemContent)) {
                 $retval .= $indstr . Xml::element($elemName, $elemValue, $subElemContent);
             } elseif (!count($indElements) && !count($subElements)) {
                 $retval .= $indstr . Xml::element($elemName, $elemValue);
             } else {
                 $retval .= $indstr . Xml::element($elemName, $elemValue, null);
                 foreach ($subElements as $subElemId => &$subElemValue) {
                     $retval .= self::recXmlPrint($subElemId, $subElemValue, $indent);
                 }
                 foreach ($indElements as &$subElemValue) {
                     $retval .= self::recXmlPrint($subElemIndName, $subElemValue, $indent);
                 }
                 $retval .= $indstr . Xml::closeElement($elemName);
             }
             break;
         case 'object':
             // ignore
             break;
         default:
             $retval .= $indstr . Xml::element($elemName, null, $elemValue);
             break;
     }
     return $retval;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:95,代码来源:ApiFormatXml.php

示例6: wfBlankImgUrl

    $isNumber1 = false;
    if ($index == 1 && !$number1Found && !empty($items[$index]) && $items[$index]->getVotesCount() != $item->getVotesCount()) {
        $isNumber1 = true;
        $number1Found = true;
    }
    ?>
				<div class="ItemNumber<?php 
    echo $isNumber1 ? ' No1' : ' NotVotable';
    ?>
">
					<span>#<?php 
    echo $index;
    ?>
</span>
					<button class="VoteButton" id="<?php 
    echo Sanitizer::encodeAttribute($item->getTitle()->getSubpageText());
    ?>
">
						<img src="<?php 
    echo wfBlankImgUrl();
    ?>
" class="chevron"/>
						<?php 
    echo wfMessage('toplists-list-vote-up')->inContentLanguage()->escaped();
    ?>
					</button>
				</div>
				<div class="ItemContent">
					<?php 
    echo $item->getParsedContent();
    ?>
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:list.tmpl.php

示例7: array

	<?php 
    echo F::app()->renderView('MenuButton', 'Index', array('action' => array("text" => wfMessage('category-exhibition-' . $current)->escaped(), "id" => "category-exhibition-form-current"), 'class' => 'secondary', 'dropdown' => $dropdown, 'name' => 'sortType'));
    ?>
	<?php 
}
?>
	<a title="<?php 
echo wfMessage('category-exhibition-display-old')->escaped();
?>
" id="category-exhibition-form-new" href="<?php 
echo Sanitizer::encodeAttribute($path . '?display=page&sort=' . urlencode($current));
?>
" ><div id="category-exhibition-display-old" <?php 
if ($displayType == 'page') {
    echo ' class="active"';
}
?>
 ></div></a> | <a title="<?php 
echo wfMessage('category-exhibition-display-new')->escaped();
?>
" id="category-exhibition-form-old" href="<?php 
echo Sanitizer::encodeAttribute($path . '?display=exhibition&sort=' . urlencode($current));
?>
" ><div id="category-exhibition-display-new" <?php 
if ($displayType == 'exhibition') {
    echo ' class="active"';
}
?>
 ></div></a>
</div>
开发者ID:Tjorriemorrie,项目名称:app,代码行数:30,代码来源:form.tmpl.php

示例8: formatListItem

    /**
     * Format a single list item from a database row.
     * @param $row Database row object
     * @param $params An array of flags. Valid flags:
     * * admin (user can show/hide feedback items)
     * * show-anyway (user has asked to see this hidden item)
     * @param $response An array of response for feedback
     * @return string HTML
     */
    public static function formatListItem($row, $params = array(), $response = array())
    {
        global $wgLang, $wgUser;
        $classes = array('fbd-item');
        $toolLinks = array();
        //in case there is an error constructing the feedbackitem object,
        //we don't want to throw an error for the entire page.
        try {
            $feedbackItem = MBFeedbackItem::load($row);
        } catch (Exception $e) {
            $classes = Sanitizer::encodeAttribute(implode(' ', $classes));
            $error_message = wfMessage('moodbar-feedback-load-record-error')->escaped();
            return <<<HTML
\t\t\t<li class="{$classes}">
\t\t\t\t<div class="fbd-item-message" dir="auto">{$error_message}</div>
\t\t\t\t<div style="clear:both"></div>
\t\t\t</li>
HTML;
        }
        // Type
        $type = $feedbackItem->getProperty('type');
        $typeMsg = wfMessage("moodbar-type-{$type}")->params($feedbackItem->getProperty('user'))->escaped();
        // Timestamp
        $timestamp = wfTimestamp(TS_UNIX, $feedbackItem->getProperty('timestamp'));
        $timeMsg = wfMessage('ago')->params(MoodBarUtil::formatTimeSince($timestamp))->escaped();
        // Comment
        $comment = htmlspecialchars($feedbackItem->getProperty('comment'));
        // User information
        $userInfo = self::buildUserInfo($feedbackItem);
        // Tool links
        $toolLinks[] = self::getPermalink($feedbackItem);
        // Continuation data
        $id = $feedbackItem->getProperty('id');
        $continueData = wfTimestamp(TS_MW, $timestamp) . '|' . intval($id);
        // Now handle hiding, showing, etc
        if ($feedbackItem->getProperty('hidden-state') > 0) {
            $toolLinks = array();
            if (!in_array('show-anyway', $params)) {
                $userInfo = wfMessage('moodbar-user-hidden')->escaped();
                $comment = wfMessage('moodbar-comment-hidden')->escaped();
                $type = 'hidden';
                $typeMsg = '';
                $classes[] = 'fbd-hidden';
            }
            if (in_array('admin', $params)) {
                if (in_array('show-anyway', $params)) {
                    $toolLinks[] = self::getHiddenFooter($feedbackItem, 'shown');
                } else {
                    $toolLinks[] = self::getHiddenFooter($feedbackItem, 'hidden');
                }
            }
        } elseif (in_array('admin', $params)) {
            $toolLinks[] = self::getHideLink($feedbackItem);
        }
        $responseElements = self::buildResponseElement($feedbackItem, $response);
        $classes = Sanitizer::encodeAttribute(implode(' ', $classes));
        $toolLinks = implode("\n", $toolLinks);
        return <<<HTML
\t\t<li class="{$classes}" data-mbccontinue="{$continueData}">
\t\t\t<div class="fbd-item-emoticon fbd-item-emoticon-{$type}">
\t\t\t\t<span class="fbd-item-emoticon-label">{$typeMsg}</span>
\t\t\t</div>
\t\t\t<div class="fbd-item-time">{$timeMsg}</div>
\t\t\t{$userInfo}
\t\t\t<div class="fbd-item-message" dir="auto">{$comment}</div>
\t\t\t{$toolLinks}
\t\t\t{$responseElements}
\t\t\t<div style="clear:both"></div>
\t\t</li>
HTML;
    }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:80,代码来源:SpecialFeedbackDashboard.php

示例9: execute


//.........这里部分代码省略.........
         $wgOut->addHTML(wfMsg('soapfailures-mark-as-fixed') . "\n\t\t\t\t\t\t\t<form method='post'>\n\t\t\t\t\t\t\t\t" . wfMsg('soapfailures-artist') . " <input type='text' name='artist'/><br/>\n\t\t\t\t\t\t\t\t" . wfMsg('soapfailures-song') . " <input type='text' name='song'/><br/>\n\t\t\t\t\t\t\t\t<input type='submit' name='fixed' value='" . wfMsg('soapfailures-fixed') . "'/>\n\t\t\t\t\t\t\t</form><br/>");
         $data = $wgMemc->get($CACHE_KEY_DATA);
         $cachedOn = $wgMemc->get($CACHE_KEY_TIME);
         $statsHtml = $wgMemc->get($CACHE_KEY_STATS);
         if (!$data) {
             $db =& wfGetDB(DB_SLAVE)->getProperty('mConn');
             $queryString = "SELECT * FROM lw_soap_failures ORDER BY numRequests DESC LIMIT {$MAX_RESULTS}";
             if ($result = mysql_query($queryString, $db)) {
                 $data = array();
                 if (($numRows = mysql_num_rows($result)) && $numRows > 0) {
                     for ($cnt = 0; $cnt < $numRows; $cnt++) {
                         $row = array();
                         $row['artist'] = mysql_result($result, $cnt, "request_artist");
                         $row['song'] = mysql_result($result, $cnt, "request_song");
                         $row['numRequests'] = mysql_result($result, $cnt, "numRequests");
                         $row['lookedFor'] = mysql_result($result, $cnt, "lookedFor");
                         $row['lookedFor'] = formatLookedFor($row['lookedFor']);
                         $data[] = $row;
                     }
                 }
             } else {
                 $wgOut->addHTML("<br/><br/><strong>Error: with query</strong><br/><em>{$queryString}</em><br/><strong>Error message: </strong>" . mysql_error($db));
             }
             $cachedOn = date('m/d/Y \\a\\t g:ia');
         }
         // Stats HTML is just an unimportant feature, hackily storing HTML instead of the data - FIXME: It's BAD to cache output rather than data.
         if (!$statsHtml) {
             // Display some hit-rate stats.
             ob_start();
             include_once __DIR__ . "/soap_stats.php";
             // for tracking success/failure
             print "<br/><br/><br/>";
             print "<em>" . wfMsg('soapfailures-stats-header') . "</em><br/>\n";
             print "<table border='1px' cellpadding='5px'>\n";
             print "\t<tr><th>" . wfMsg('soapfailures-stats-timeperiod') . "</th><th>" . wfMsg('soapfailures-stats-numfound') . "</th><th>" . wfMsg('soapfailures-stats-numnotfound') . "</th><th>&nbsp;</th></tr>\n";
             $stats = lw_soapStats_getStats(LW_TERM_DAILY, "", LW_API_TYPE_WEB);
             print "\t<tr><td>" . wfMsg('soapfailures-stats-period-today') . "</td><td>{$stats[LW_API_FOUND]}</td><td>{$stats[LW_API_NOT_FOUND]}</td><td>{$stats[LW_API_PERCENT_FOUND]}%</td></tr>\n";
             $stats = lw_soapStats_getStats(LW_TERM_WEEKLY, "", LW_API_TYPE_WEB);
             print "\t<tr><td>" . wfMsg('soapfailures-stats-period-thisweek') . "</td><td>{$stats[LW_API_FOUND]}</td><td>{$stats[LW_API_NOT_FOUND]}</td><td>{$stats[LW_API_PERCENT_FOUND]}%</td></tr>\n";
             $stats = lw_soapStats_getStats(LW_TERM_MONTHLY, "", LW_API_TYPE_WEB);
             print "\t<tr><td>" . wfMsg('soapfailures-stats-period-thismonth') . "</td><td>{$stats[LW_API_FOUND]}</td><td>{$stats[LW_API_NOT_FOUND]}</td><td>{$stats[LW_API_PERCENT_FOUND]}%</td></tr>\n";
             print "</table>\n";
             $statsHtml = ob_get_clean();
         }
         if ($data) {
             $wgOut->addWikiText(wfMsg('soapfailures-intro'));
             $wgOut->addHTML("This page is cached every 2 hours - \n");
             // TODO: i18n
             $wgOut->addHTML("last cached: <strong>{$cachedOn}</strong>\n");
             // TODO: i18n
             $totFailures = 0;
             if (!empty($data)) {
                 $wgOut->addHTML("<table class='soapfailures'>\n");
                 $wgOut->addHTML("<tr><th nowrap='nowrap'>" . wfMsg('soapfailures-header-requests') . "</th><th>" . wfMsg('soapfailures-header-artist') . "</th><th>" . wfMsg('soapfailures-header-song') . "</th><th>" . wfMsg('soapfailures-header-looked-for') . "</th><th>" . wfMsg('soapfailures-header-fixed') . "</th></tr>\n");
                 $REQUEST_URI = $_SERVER['REQUEST_URI'];
                 $rowIndex = 0;
                 foreach ($data as $row) {
                     $artist = $row['artist'];
                     $song = $row['song'];
                     $numRequests = $row['numRequests'];
                     $lookedFor = $row['lookedFor'];
                     $totFailures += $numRequests;
                     $wgOut->addHTML(utf8_encode("<tr" . ($rowIndex % 2 != 0 ? " class='odd'" : "") . "><td>{$numRequests}</td><td>"));
                     $wgOut->addWikiText("[[{$artist}]]");
                     $wgOut->addHTML("</td><td>");
                     $wgOut->addWikiText("[[{$artist}:{$song}|{$song}]]");
                     $delim = "&amp;";
                     $prefix = "";
                     // If the short-url is in the REQUEST_URI, make sure to add the index.php?title= prefix to it.
                     if (strpos($REQUEST_URI, "index.php?title=") === false) {
                         $prefix = "/index.php?title=";
                         // If we're adding the index.php ourselves, but the request still started with a slash, remove it because that would break the request if it came after the "title="
                         if (substr($REQUEST_URI, 0, 1) == "/") {
                             $REQUEST_URI = substr($REQUEST_URI, 1);
                         }
                     }
                     $wgOut->addHTML("</td><td>");
                     $wgOut->addWikiText("{$lookedFor}");
                     $wgOut->addHTML("</td><td>");
                     $wgOut->addHTML("<form action='' method='POST' target='_blank'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='artist' value=\"" . Sanitizer::encodeAttribute($artist) . "\"/>\n\t\t\t\t\t\t\t\t<input type='hidden' name='song' value=\"" . Sanitizer::encodeAttribute($song) . "\"/>\n\t\t\t\t\t\t\t\t<input type='submit' name='fixed' value=\"" . wfMessage('soapfailures-fixed')->escaped() . "\"/>\n\t\t\t\t\t\t\t</form>\n");
                     $wgOut->addHTML("</td>");
                     $wgOut->addHTML("</tr>\n");
                     $rowIndex++;
                 }
                 $wgOut->addHTML("</table>\n");
                 $wgOut->addHTML("<br/>Total of <strong id='lw_numFailures'>{$totFailures}</strong> requests in the top {$MAX_RESULTS}.  This number will increase slightly over time, but we should fight to keep it as low as possible!");
             } else {
                 $wgOut->addHTML("<em>No results found.</em>\n");
             }
             if (!empty($data)) {
                 $TWO_HOURS_IN_SECONDS = 60 * 60 * 2;
                 $wgMemc->set($CACHE_KEY_TIME, $cachedOn, $TWO_HOURS_IN_SECONDS);
                 $wgMemc->set($CACHE_KEY_STATS, $statsHtml, $TWO_HOURS_IN_SECONDS);
                 // We use CACHE_KEY_DATA to determine when all of these keys have expired, so it should expire a few microseconds after the other two (that's why it's below the other set()s).
                 $wgMemc->set($CACHE_KEY_DATA, $data, $TWO_HOURS_IN_SECONDS);
             }
         }
         $wgOut->addHTML($statsHtml);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:101,代码来源:Special_Soapfailures.php

示例10: wfMessage

}
?>
	<form method=post action="<?php 
echo $formPostAction;
?>
">
		<input type=hidden name=loginToken id='loginToken' value="<?php 
echo Sanitizer::encodeAttribute($loginToken);
?>
">
		<input type=hidden name=keeploggedin value=true>
		<?php 
if (!empty($returnto)) {
    ?>
			<input type=hidden name=returnto value="<?php 
    echo Sanitizer::encodeAttribute($returnto);
    ?>
">
		<?php 
}
?>
		<input type=text name=username class=wkInp
		       placeholder='<?php 
echo wfMessage('yourname')->escaped();
?>
'<?php 
echo $username ? ' value="' . htmlspecialchars($username) . '"' : '';
echo $userErr ? ' class=inpErr' : '';
?>
>
		<?php 
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:UserLoginSpecial_WikiaMobileIndex.php

示例11: foreach

        ?>
</th>
						<?php 
    }
    ?>
					</tr>
					<?php 
    foreach ($content as $item) {
        ?>
						<tr class="insights-list-item">
							<td class="insights-list-item-page insights-list-cell insights-list-first-column">
								<a class="insights-list-item-title <?php 
        echo Sanitizer::encodeAttribute($item['link']['classes']);
        ?>
" title="<?php 
        echo Sanitizer::encodeAttribute($item['link']['title']);
        ?>
" href="<?php 
        echo Sanitizer::cleanUrl($item['link']['url']);
        ?>
"><?php 
        echo Sanitizer::escapeHtmlAllowEntities($item['link']['text']);
        ?>
</a>
								<?php 
        if (isset($item['metadata'])) {
            ?>
									<p class="insights-list-item-metadata">
										<?php 
            if (isset($item['metadata']['lastRevision'])) {
                ?>
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:Insights_subpageList.php

示例12: wfMessage

 * @var string $birthday
 * @var bool $isEn
 * @var string $createAccountButtonLabel
 * @var string $returnto
 * @var string $msg
 * @var array $avatars
 * @var array $popularWikis
 */
$form = ['id' => 'WikiaSignupForm', 'method' => 'post', 'inputs' => [['type' => 'hidden', 'name' => 'signupToken', 'value' => Sanitizer::encodeAttribute($signupToken)], ['type' => 'hidden', 'name' => 'username', 'value' => '', 'label' => wfMessage('yourname')->escaped()], ['type' => 'text', 'name' => 'userloginext01', 'value' => htmlspecialchars($username), 'label' => wfMessage('yourname')->escaped(), 'isRequired' => true, 'isInvalid' => !empty($errParam) && $errParam === 'username', 'errorMsg' => !empty($msg) ? $msg : ''], ['type' => 'text', 'name' => 'email', 'value' => Sanitizer::encodeAttribute($email), 'label' => wfMessage('email')->escaped(), 'isRequired' => true, 'isInvalid' => !empty($errParam) && $errParam === 'email', 'errorMsg' => !empty($msg) ? $msg : ''], ['type' => 'hidden', 'name' => 'password', 'value' => '', 'label' => wfMessage('yourpassword')->escaped()], ['type' => 'password', 'name' => 'userloginext02', 'value' => '', 'label' => wfMessage('yourpassword')->escaped(), 'isRequired' => true, 'isInvalid' => !empty($errParam) && $errParam === 'password', 'errorMsg' => !empty($msg) ? $msg : ''], ['type' => 'hidden', 'name' => 'wpRegistrationCountry', 'value' => ''], ['type' => 'nirvanaview', 'controller' => 'UserSignupSpecial', 'view' => 'birthday', 'isRequired' => true, 'isInvalid' => !empty($errParam) && $errParam === 'birthyear' || !empty($errParam) && $errParam === 'birthmonth' || !empty($errParam) && $errParam === 'birthday', 'errorMsg' => !empty($msg) ? $msg : '', 'params' => ['birthyear' => $birthyear, 'birthmonth' => $birthmonth, 'birthday' => $birthday, 'isEn' => $isEn]], ['type' => 'nirvana', 'controller' => 'UserSignupSpecial', 'method' => 'captcha', 'isRequired' => true, 'class' => 'captcha', 'isInvalid' => !empty($errParam) && $errParam === 'wpCaptchaWord', 'errorMsg' => !empty($msg) ? $msg : ''], ['class' => 'opt-in-container hidden', 'type' => 'checkbox', 'name' => 'wpMarketingOptIn', 'label' => wfMessage('userlogin-opt-in-label')->escaped()], ['type' => 'nirvanaview', 'controller' => 'UserSignupSpecial', 'view' => 'submit', 'class' => 'submit-pane error', 'params' => ['createAccountButtonLabel' => $createAccountButtonLabel]]]];
$form['isInvalid'] = !empty($result) && $result === 'error' && empty($errParam);
$form['errorMsg'] = $form['isInvalid'] ? $msg : '';
if (!empty($returnto)) {
    $form['inputs'][] = ['type' => 'hidden', 'name' => 'returnto', 'value' => Sanitizer::encodeAttribute($returnto)];
}
if (!empty($byemail)) {
    $form['inputs'][] = ['type' => 'hidden', 'name' => 'byemail', 'value' => Sanitizer::encodeAttribute($byemail)];
}
?>

<section class="WikiaSignup">
	<?php 
if (!$isMonobookOrUncyclo) {
    ?>
		<h2 class="pageheading">
			<?php 
    echo $pageHeading;
    ?>
		</h2>
		<h3 class="subheading"></h3>
		<div class="wiki-info">
			<?php 
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:UserSignupSpecial_signupForm.php

示例13: array

<div class="UserLogin ChangePassword">
	<?php 
if (!empty($pageHeading)) {
    ?>
		<h1><?php 
    echo $pageHeading;
    ?>
</h1>
	<?php 
}
?>
	<?php 
if (!empty($subheading)) {
    ?>
		<h2 class="subheading"><?php 
    echo $subheading;
    ?>
</h2>
	<?php 
}
?>
	<?php 
$form = array('method' => 'post', 'action' => $formPostAction, 'inputs' => array(array('type' => 'hidden', 'name' => 'editToken', 'value' => htmlspecialchars($editToken)), array('type' => 'hidden', 'name' => 'loginToken', 'value' => htmlspecialchars($loginToken)), array('type' => 'hidden', 'name' => 'username', 'value' => htmlspecialchars($username)), array('type' => 'hidden', 'name' => 'returnto', 'value' => Sanitizer::encodeAttribute($returnto)), array('type' => 'custom', 'output' => '<label>' . wfMessage('yourname')->escaped() . '</label><p class="username">' . htmlspecialchars($username) . '</p>'), array('type' => 'password', 'name' => 'password', 'id' => 'password', 'label' => wfMessage('userlogin-oldpassword')->escaped(), 'value' => htmlspecialchars($password)), array('type' => 'password', 'name' => 'newpassword', 'id' => 'newpassword', 'label' => wfMessage('userlogin-newpassword')->escaped()), array('type' => 'password', 'name' => 'retype', 'id' => 'retype', 'label' => wfMessage('userlogin-retypenew')->escaped())), 'submits' => array(array('value' => wfMessage('resetpass_submit')->escaped(), 'name' => 'action', 'class' => 'big login-button')));
$form['isInvalid'] = $result == 'error';
$form['errorMsg'] = !empty($msg) ? $msg : '';
echo F::app()->renderView('WikiaStyleGuideForm', 'index', array('form' => $form));
?>
</div>
开发者ID:Tjorriemorrie,项目名称:app,代码行数:28,代码来源:UserLoginSpecial_changePassword.php

示例14: array

<div id="UserLoginDropdown" class="UserLoginDropdown subnav">
<?php 
$tabIndex = 0;
$form = array('inputs' => array(array('type' => 'hidden', 'name' => 'loginToken', 'value' => ''), array('type' => 'hidden', 'name' => 'returnto', 'value' => Sanitizer::encodeAttribute($returnto)), array('type' => 'hidden', 'name' => 'returntoquery', 'value' => Sanitizer::encodeAttribute($returntoquery)), array('type' => 'text', 'name' => 'username', 'isRequired' => true, 'label' => wfMessage('yourname')->escaped(), 'tabindex' => ++$tabIndex), array('type' => 'password', 'name' => 'password', 'class' => 'password-input', 'isRequired' => true, 'label' => wfMessage('yourpassword')->escaped(), 'tabindex' => ++$tabIndex), array('type' => 'nirvanaview', 'controller' => 'UserLogin', 'view' => 'forgotPasswordLink'), array('type' => 'checkbox', 'name' => 'keeploggedin', 'class' => 'keep-logged-in', 'value' => '1', 'label' => wfMessage('userlogin-remembermypassword')->escaped(), 'tabindex' => ++$tabIndex), array('type' => 'submit', 'value' => wfMessage('login')->escaped(), 'class' => 'login-button', 'tabindex' => ++$tabIndex)), 'method' => 'post', 'action' => $formPostAction);
$form['isInvalid'] = true;
$form['errorMsg'] = '';
echo $app->renderView('WikiaStyleGuideForm', 'index', array('form' => $form));
// 3rd party providers buttons
echo $app->renderView('UserLoginSpecial', 'Providers', array('tabindex' => ++$tabIndex));
?>
</div>
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:UserLoginSpecial_dropdown.php

示例15:

<footer class="global-footer">
	<nav>
		<div class="branding <?php 
echo !empty($verticalShort) ? 'vertical-' . $verticalShort : '';
?>
 <?php 
echo !$isCorporate ? 'black' : '';
?>
">
			<a class="wikia-logo" href="<?php 
echo Sanitizer::encodeAttribute($logoLink);
?>
">
				<img src="<?php 
echo $wg->BlankImgUrl;
?>
">
				<?php 
if (!$isCorporate && !empty($verticalShort)) {
    ?>
					<span><?php 
    echo $verticalNameMessage->escaped();
    ?>
</span>
				<?php 
}
?>
			</a>
		</div>
		<ul>
			<?php 
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:GlobalFooter_index.php


注:本文中的Sanitizer::encodeAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。