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


PHP eZURLAliasML::sanitizeURL方法代码示例

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


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

示例1: while

 while (true) {
     // Validate the wildcards
     if (!preg_match("#^(.*)\\*\$#", $sourceWildcard, $matches)) {
         logError("Invalid source wildcard '{$sourceWildcard}', item is skipped, URL entry ID is " . $row['id']);
         list($column, $counter) = displayProgress('E', $urlImportStartTime, $counter, $urlCount, $column);
         continue 2;
     }
     $fromPath = $matches[1];
     $fromPath = eZURLAliasML::sanitizeURL($fromPath);
     if (!preg_match("#^(.*)\\{1\\}\$#", $destinationWildcard, $matches)) {
         logError("Invalid destination wildcard '{$destinationWildcard}', item is skipped, URL entry ID is " . $row['id']);
         list($column, $counter) = displayProgress('E', $urlImportStartTime, $counter, $urlCount, $column);
         continue 2;
     }
     $toPath = $matches[1];
     $toPath = eZURLAliasML::sanitizeURL($toPath);
     $newWildcard = $toPath . '/*';
     $newWildcardSQL = $db->escapeString($newWildcard);
     $query = "SELECT * FROM ezurlalias WHERE source_url = '{$newWildcardSQL}' AND is_wildcard=1";
     $rowsw = $db->arrayQuery($query);
     if (count($rowsw) == 0) {
         // The redirection has stopped, we can use the destination
         break;
     }
     $newSourceWildcard = $rowsw[0]['destination_url'];
     if (!preg_match("#^(.*)\\{1\\}\$#", $newSourceWildcard, $matches)) {
         logError("Invalid destination wildcard '{$destinationWildcard}', item is skipped, URL entry ID is " . $rowsw[0]['id']);
         list($column, $counter) = displayProgress('E', $urlImportStartTime, $counter, $urlCount, $column);
         continue 2;
     }
     $newSourceWildcard = $matches[1];
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:updateniceurls.php

示例2: testSanitizeURL

 public function testSanitizeURL()
 {
     $url1 = "/content/view/full/2";
     $url2 = "/////content/view/full/2/";
     $url3 = "/content/view/full/2///";
     $url4 = "///content/view/full/2///";
     $url5 = "///content///view////full//2///";
     self::assertEquals("content/view/full/2", eZURLAliasML::sanitizeURL($url1));
     self::assertEquals("content/view/full/2", eZURLAliasML::sanitizeURL($url2));
     self::assertEquals("content/view/full/2", eZURLAliasML::sanitizeURL($url3));
     self::assertEquals("content/view/full/2", eZURLAliasML::sanitizeURL($url4));
     self::assertEquals("content/view/full/2", eZURLAliasML::sanitizeURL($url5));
     // Make sure funky characters doesn't get messed up
     $invalidUrl = "//ウ//ー//ラ//";
     self::assertEquals("ウ/ー/ラ", eZURLAliasML::sanitizeURL($invalidUrl));
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:16,代码来源:urlaliasml_test.php

示例3: while

 while (true) {
     // Validate the wildcards
     if (!preg_match("#^(.*)\\*\$#", $sourceWildcard, $matches)) {
         logError("Invalid source wildcard '{$sourceWildcard}', item is skipped, URL entry ID is " . $row['id']);
         list($column, $counter) = displayProgress('E', $urlImportStartTime, $counter, $urlCount, $column);
         continue 2;
     }
     $fromPath = $matches[1];
     $fromPath = eZURLAliasML::sanitizeURL($fromPath, true);
     if (!preg_match("#^(.*)\\{1\\}\$#", $destinationWildcard, $matches)) {
         logError("Invalid destination wildcard '{$destinationWildcard}', item is skipped, URL entry ID is " . $row['id']);
         list($column, $counter) = displayProgress('E', $urlImportStartTime, $counter, $urlCount, $column);
         continue 2;
     }
     $toPath = $matches[1];
     $toPath = eZURLAliasML::sanitizeURL($toPath, true);
     $newWildcard = $toPath . '/*';
     $newWildcardSQL = $db->escapeString($newWildcard);
     $query = "SELECT * FROM ezurlalias WHERE source_url = '{$newWildcardSQL}' AND is_wildcard=1";
     $rowsw = $db->arrayQuery($query);
     if (count($rowsw) == 0) {
         // The redirection has stopped, we can use the destination
         break;
     }
     $newSourceWildcard = $rowsw[0]['destination_url'];
     if (!preg_match("#^(.*)\\{1\\}\$#", $newSourceWildcard, $matches)) {
         logError("Invalid destination wildcard '{$destinationWildcard}', item is skipped, URL entry ID is " . $rowsw[0]['id']);
         list($column, $counter) = displayProgress('E', $urlImportStartTime, $counter, $urlCount, $column);
         continue 2;
     }
     $newSourceWildcard = $matches[1];
开发者ID:nlenardou,项目名称:ezpublish,代码行数:31,代码来源:updateniceurls.php


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