100+ results for 'php preg_quote'
Not the results you expected?
class-vc-grid-item.php (https://gitlab.com/furrutia1991/imosa_web) PHP · 357 lines
1 <?php
3 /**
24 public function shortcodes() {
25 if ( false === $this->shortcodes ) {
26 $this->shortcodes = include vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/shortcodes.php' );
27 $this->shortcodes = apply_filters( 'vc_grid_item_shortcodes', $this->shortcodes );
28 }
50 */
51 public function addVcIconShortcodesTemplates( $template ) {
52 $file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_icon.php' );
53 if ( is_file( $file ) ) {
54 return $file;
66 */
67 public function addVcButton2ShortcodesTemplates( $template ) {
68 $file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_button2.php' );
69 if ( is_file( $file ) ) {
70 return $file;
Array.php (git://github.com/atk4/atk4.git) PHP · 212 lines
ShallowParser.php (https://bitbucket.org/leiweiqiang/tra-ai-pm.git) PHP · 233 lines
1 <?php
3 /* vim: set shiftwidth=2 expandtab softtabstop=2: */
70 public function quote($token) {
71 return preg_quote($token, '/');
72 }
90 $result->state = end($result->states);
91 $result->terminator = $result->state
92 ? '/^(.*?' . preg_quote($this->_pairs[$result->state], '/') . ')/s'
93 : null
94 ;
systematics.inc.php (https://gitlab.com/Gashler/sg) PHP · 141 lines
1 <?php
2 /**
3 * Systematics *(for current page)*.
86 return ($is_wp_systematic = apply_filters('ws_plugin__s2member_is_wp_systematic_use_page', TRUE, get_defined_vars()));
88 if((defined('DOING_CRON') && DOING_CRON) || strcasecmp(PHP_SAPI, 'CLI') === 0) // CLI or CRON job.
89 return ($is_wp_systematic = apply_filters('ws_plugin__s2member_is_wp_systematic_use_page', TRUE, get_defined_vars()));
91 if(preg_match('/^\/(?:wp-.+?|xmlrpc)\.php$/'.$ci, c_ws_plugin__s2member_utils_urls::parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)))
92 return ($is_wp_systematic = apply_filters('ws_plugin__s2member_is_wp_systematic_use_page', TRUE, get_defined_vars()));
133 return ($is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars()));
135 if($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_redirection_override'] && ($_lro = c_ws_plugin__s2member_login_redirects::login_redirection_uri(NULL, 'root-returns-false')) && preg_match('/^'.preg_quote($_lro, '/').'$/'.$ci, $_SERVER['REQUEST_URI']))
136 return ($is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars()));
Suffix.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 185 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
21 /**
22 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
23 */
24 class Suffix extends \Magento\Framework\App\Config\Value
53 * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
54 * @param array $data
55 * @SuppressWarnings(PHPMD.ExcessiveParameterList)
56 */
57 public function __construct(
135 }
136 $entities = $this->urlFinder->findAllByData($dataFilter);
137 $oldSuffixPattern = '~' . preg_quote($this->getOldValue()) . '$~';
138 $suffix = $this->getValue();
139 foreach ($entities as $urlRewrite) {
ExtensionSet.php (https://gitlab.com/dcnf/dcbase.org) PHP · 438 lines
1 <?php
3 /*
160 foreach ($this->functions as $pattern => $function) {
161 $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
163 if ($count && preg_match('#^'.$pattern.'$#', $name, $matches)) {
216 foreach ($this->filters as $pattern => $filter) {
217 $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
219 if ($count && preg_match('#^'.$pattern.'$#', $name, $matches)) {
341 foreach ($this->tests as $pattern => $test) {
342 $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
344 if ($count) {
smarty_internal_compile_extends.php (https://github.com/basdog22/Qool.git) PHP · 128 lines
template.php (https://bitbucket.org/magnusmanske/magnustools.git) PHP · 326 lines
1 <?php
3 /**
5 * @author Soxred93 <soxred93@gmail.com>
6 * @copyright Copyright (c) 2009, Sam Korn
7 * @license http://opensource.org/licenses/mit-license.php MIT License
8 */
70 }
72 $name = "(?i:" . substr(preg_quote($name,'/'),0,1) . ")" . substr($name,1);
73 preg_match("/\{\{" . $name . "\s*(?:(?:\|.*)|(?:\}.*))/s",$text,$match);
74 if (isset($match[0])) {
236 }
238 $newfields[$newname] = preg_replace('/^(\s*)' . preg_quote($oldname,'/') . '(\s*=)/is',"$1" . $newname . "$2",$field);
239 }
240 $this->fields = $newfields;
User_agent.php (https://github.com/usagi-project/mynets1.git) PHP · 500 lines
1 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
158 foreach ($this->platforms as $key => $val)
159 {
160 if (preg_match("|".preg_quote($key)."|i", $this->agent))
161 {
162 $this->platform = $val;
182 foreach ($this->browsers as $key => $val)
183 {
184 if (preg_match("|".preg_quote($key).".*?([0-9\.]+)|i", $this->agent, $match))
185 {
186 $this->is_browser = TRUE;
smarty_internal_resource_extends.php (https://bitbucket.org/miguelgazela/rogo.git) PHP · 162 lines
1 <?php
2 /**
3 * Smarty Internal Plugin Resource Extends
40 foreach ($components as $component) {
41 $s = Smarty_Resource::source(null, $source->smarty, $component);
42 if ($s->type == 'php') {
43 throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");
44 }
89 $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
90 $_rdl = preg_quote($source->smarty->right_delimiter);
91 $_ldl = preg_quote($source->smarty->left_delimiter);
db_info.inc.php (https://github.com/slikk66/DbAdmin.git) PHP · 210 lines
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
10 * speedup view on locked tables
11 *
12 * @package PhpMyAdmin
13 */
14 if (! defined('PHPMYADMIN')) {
103 if (! empty($_REQUEST['tbl_group'])
104 && ! preg_match('@' . preg_quote($_REQUEST['tbl_group'], '@') . '@i', $sts_tmp['Comment'])
105 ) {
106 continue;
168 $total_num_tables = count($tables);
169 if (isset($sub_part) && $sub_part == '_export') {
170 // (don't fetch only a subset if we are coming from db_export.php,
171 // because I think it's too risky to display only a subset of the
172 // table names when exporting a db)
DelegatingValidator.php (https://github.com/xbojer/gfw.git) PHP · 259 lines
1 <?php
3 /*
156 foreach ($form->getAttribute('error_mapping') as $nestedDataPath => $nestedNamePath)
157 {
158 $mapping['/^'.preg_quote($formPath.'.data.'.$nestedDataPath).'(?!\w)/'] = $namePath.'.'.$nestedNamePath;
159 }
183 }
185 $mapping['/^'.preg_quote($nestedFormPath, '/').'(?!\w)/'] = $child;
186 }
187 }
191 foreach ($form->getAttribute('error_mapping') as $nestedDataPath => $nestedNamePath)
192 {
193 $mapping['/^'.preg_quote($dataPath.'.'.$nestedDataPath).'(?!\w)/'] = $namePath.'.'.$nestedNamePath;
194 }
UrlMatcherTest.php (https://github.com/Faianca/symfony.git) PHP · 208 lines
1 <?php
3 /*
19 use Symfony\Component\Routing\RequestContext;
21 class UrlMatcherTest extends \PHPUnit_Framework_TestCase
22 {
23 public function testNoMethodSoAllowed()
155 $collection = new RouteCollection();
156 $chars = '!"$%éà &\'()*+,./:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[]^_`abcdefghijklmnopqrstuvwxyz{|}~-';
157 $collection->add('foo', new Route('/{foo}/bar', array(), array('foo' => '['.preg_quote($chars).']+')));
159 $matcher = new UrlMatcher($collection, new RequestContext(), array());
Cookie.php (https://github.com/lostechies/wordpress.git) PHP · 526 lines
sql_parse.php (https://github.com/cpg-contrib/coppermine.git) PHP · 174 lines
1 <?php
2 /*************************
3 Coppermine Photo Gallery
19 /**
20 * sql_parse.php
21 * -------------------
22 * begin : Thu May 31, 2001
23 * copyright : (C) 2001 The phpBB Group
24 * email : support@phpbb.com
37 * These functions are mainly for use in the db_utilities under the admin
38 * however in order to make these functions available elsewhere, specifically
39 * in the installation phase of phpBB I have seperated out a couple of
40 * functions into this file. JLH
41 *
smarty_internal_resource_extends.php (https://github.com/kiang/olc_baker.git) PHP · 178 lines
1 <?php
3 /**
19 {
20 $this->smarty = $smarty;
21 $this->_rdl = preg_quote($smarty->right_delimiter);
22 $this->_ldl = preg_quote($smarty->left_delimiter);
174 }
176 return $_compile_dir . $_filepath . '.' . $_template->resource_type . '.' . basename($_files[count($_files)-1]) . $_cache . '.php';
177 }
178 }
sfValidatorDateTest.php (https://github.com/StefanRHRO/SCRM.git) PHP · 246 lines
1 <?php
3 /*
9 */
11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php');
13 $t = new lime_test(52);
100 {
101 $t->pass('->clean() throws a sfValidatorError if the date does not match the regex');
102 $t->like($e->getMessage(), '/'.preg_quote(htmlspecialchars($v->getOption('date_format'), ENT_QUOTES, 'UTF-8'), '/').'/', '->clean() returns the expected date format in the error message');
103 $t->is($e->getCode(), 'bad_format', '->clean() throws a sfValidatorError');
104 }
112 catch (sfValidatorError $e)
113 {
114 $t->like($e->getMessage(), '/'.preg_quote('dd/mm/YYYY', '/').'/', '->clean() returns the expected date format error if provided');
115 }
s2member-files.php (https://gitlab.com/Gashler/dp) PHP · 108 lines
1 <?php
2 if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
3 exit("Do not access this file directly.");
5 global /* A Multisite ``$base`` configuration? */ $base;
6 $ws_plugin__s2member_temp_s_base = (!empty ($base)) ? $base : c_ws_plugin__s2member_utils_urls::parse_url (network_home_url ("/"), PHP_URL_PATH);
7 // This works on Multisite installs too. The function ``network_home_url ()`` defaults to ``home_url ()`` on standard WordPress® installs.
8 // Do NOT use ``site`` URL. Must use the `home` URL here, because that's what WordPress® uses in its own `mod_rewrite` implementation.
19 # Enable rewrite and configure base.
20 RewriteEngine On
21 RewriteBase <?php echo $ws_plugin__s2member_temp_s_base . "\n"; ?>
23 # Initialize all environment variables we're using below.
27 # Handle virtual directories, common on multisite networks.
28 RewriteCond %{ENV:s2member_file_download_wp_vdir_check} !^complete$
29 RewriteCond %{THE_REQUEST} ^(?:GET|HEAD)(?:[\ ]+)(?:<?php echo preg_quote ($ws_plugin__s2member_temp_s_base, " "); ?>)([_0-9a-zA-Z\-]+/)(?:wp-content/)
30 RewriteRule ^(.*)$ - [E=s2member_file_download_wp_vdir:,E=s2member_file_download_wp_vdir:%1,E=s2member_file_download_wp_vdir_check:complete]
Text.php (https://github.com/Nerutiz/trades.git) PHP · 213 lines
ConsoleIntegrationTestCase.php (https://github.com/LubosRemplik/cakephp.git) PHP · 324 lines
1 <?php
2 /**
3 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5 *
10 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11 * @since 3.5.0
12 * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 */
14 namespace Cake\TestSuite;
152 public function assertOutputEmpty($message = 'stdout was not empty')
153 {
154 $output = implode(PHP_EOL, $this->_out->messages());
155 $this->assertSame('', $output, $message);
156 }
RouteCompiler.php (https://github.com/sebio/symfony.git) PHP · 235 lines
1 <?php
3 /*
62 }
64 $this->regex = "#^".implode("", $this->segments)."".preg_quote($separator, '#')."$#x";
66 // optimize tokens for generation
201 $this->firstOptional = count($this->segments) + 1;
203 $this->segments[] = preg_quote($separator, '#').preg_quote($text, '#');
204 }
210 }
212 $this->segments[] = preg_quote($separator, '#').'(?P<'.$variable.'>'.$requirement.')';
213 $this->variables[$variable] = $name;
ReleaseController.php (https://gitlab.com/brucealdridge/yii2) PHP · 211 lines
1 <?php
2 /**
3 * @link http://www.yiiframework.com/
55 protected function closeChangelogs($version)
56 {
57 $v = str_replace('\\-', '[\\- ]', preg_quote($version, '/'));
58 $headline = $version . ' ' . date('F d, Y');
59 $this->sed(
200 '/function getVersion\(\)\n \{\n return \'(.+?)\';/',
201 "function getVersion()\n {\n return '$version';",
202 YII2_PATH . '/BaseYii.php');
203 }
User_agent.php (https://bitbucket.org/subhan_12/mwi-panel.git) PHP · 549 lines
1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 5.1.6 or newer
6 *
7 * @package CodeIgniter
166 foreach ($this->platforms as $key => $val)
167 {
168 if (preg_match("|".preg_quote($key)."|i", $this->agent))
169 {
170 $this->platform = $val;
190 foreach ($this->browsers as $key => $val)
191 {
192 if (preg_match("|".preg_quote($key).".*?([0-9\.]+)|i", $this->agent, $match))
193 {
194 $this->is_browser = TRUE;
CacheApc.php (https://gitlab.com/staging06/myproject) PHP · 165 lines
1 <?php
2 /*
3 * 2007-2015 PrestaShop
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
21 * @author PrestaShop SA <contact@prestashop.com>
22 * @copyright 2007-2015 PrestaShop SA
23 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24 * International Registered Trademark & Property of PrestaShop SA
25 */
63 else
64 {
65 $pattern = str_replace('\\*', '.*', preg_quote($key));
67 $cache_info = apc_cache_info((extension_loaded('apcu') === true) ? '' : 'user');
User_agent.php (https://gitlab.com/BeyondeLabs/tweet-daily) PHP · 549 lines
1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 5.1.6 or newer
6 *
7 * @package CodeIgniter
85 private function _load_agent_file()
86 {
87 if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'))
88 {
89 include(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php');
90 }
91 elseif (is_file(APPPATH.'config/user_agents.php'))
92 {
93 include(APPPATH.'config/user_agents.php');
plugin.php (https://github.com/dmillen/Ushahidi_Web.git) PHP · 292 lines
1 <?php
2 /**
3 * Plugins helper
166 foreach ( $plugin_headers as $field => $regex )
167 {
168 preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field});
169 if ( ! empty( ${$field} ) )
170 {
196 {
197 // Determine if readme.txt (Case Insensitive) exists
198 $file = PLUGINPATH.$plugin."/controllers/admin/".$plugin."_settings.php";
199 if ( file::file_exists_i($file) )
200 {
271 $configuration = array();
273 $file = PLUGINPATH.$name.'/config/'.$name.'.php';
274 if ( file_exists($file) )
275 {
SimpleStatic.php (https://github.com/koala-framework/koala-framework.git) PHP · 197 lines
1 <?php
2 /**
3 * A simple and fast cache that can't delete individual entries. Doesn't have all the Zend_Cache bloat.
33 static $extensionLoaded;
34 if (!isset($extensionLoaded)) $extensionLoaded = extension_loaded('apc');
35 if ($extensionLoaded && PHP_SAPI != 'cli') {
36 if (!isset($prefix)) $prefix = Kwf_Cache_Simple::$uniquePrefix.'-';
37 return apc_fetch($prefix.$cacheId, $success);
62 static $extensionLoaded;
63 if (!isset($extensionLoaded)) $extensionLoaded = extension_loaded('apc');
64 if ($extensionLoaded && PHP_SAPI != 'cli') {
65 if (!isset($prefix)) $prefix = Kwf_Cache_Simple::$uniquePrefix.'-';
66 $cacheIds = array_map(function($i) use ($prefix) { return $prefix.$i; }, $cacheIds);
138 if ($it->getTotalCount() && !$it->current()) {
139 //APCIterator is borked, delete everything
140 //see https://bugs.php.net/bug.php?id=59938
141 if (extension_loaded('apcu')) {
142 apc_clear_cache();
ODM.php (https://bitbucket.org/hanutimes/hanutimes.git) PHP · 120 lines
1 <?php
3 namespace Gedmo\Sluggable\Mapping\Event\Adapter;
13 *
14 * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
15 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
16 */
17 final class ODM extends BaseAdapterODM implements SluggableAdapter
28 $qb->field($meta->identifier)->notEqual($identifier);
29 }
30 $qb->field($config['slug'])->equals(new \MongoRegex('/^' . preg_quote($slug, '/') . '/'));
32 // use the unique_base to restrict the uniqueness check
35 $qb->field($config['unique_base'] . '.$id')->equals(new \MongoId($reflectValue->getId()));
36 } else {
37 $qb->where('/^' . preg_quote($reflectValue, '/') . '/.test(this.' . $config['unique_base'] . ')');
38 }
39 }
peoplesearch.php (https://gitlab.com/BeS/io.schiessle.org) PHP · 142 lines
1 <?php
2 /**
3 * People search action class.
4 *
5 * PHP version 5
6 *
7 * @category Action
33 }
35 require_once INSTALLDIR.'/lib/searchaction.php';
36 require_once INSTALLDIR.'/lib/profilelist.php';
122 parent::__construct($profile, $action);
124 $this->terms = array_map('preg_quote',
125 array_map('htmlspecialchars', $terms));
Watchdog.php (https://github.com/Alex8452/Kurogo-Mobile-Web-Doc-Translation.git) PHP · 148 lines
1 <?php
3 class Watchdog {
12 protected function __construct() {
13 // realpath returns true if the directory exists even if the file doesn't on PHP < 5.3
14 $this->workingRealpath = version_compare(PHP_VERSION, '5.3.0') >= 0;
63 $this->safePathREs = array(
64 $delimiter.
65 '^('.preg_quote(realpath(THEME_DIR), $delimiter).'|'.
66 preg_quote(realpath(SITE_DIR).DIRECTORY_SEPARATOR, $delimiter).'app|'.
67 preg_quote(realpath(ROOT_DIR).DIRECTORY_SEPARATOR, $delimiter).'app)'.
68 preg_quote(DIRECTORY_SEPARATOR, $delimiter).
69 '(common|modules'.preg_quote(DIRECTORY_SEPARATOR, $delimiter).'[^'.preg_quote(DIRECTORY_SEPARATOR, $delimiter).']+)'.
70 preg_quote(DIRECTORY_SEPARATOR, $delimiter).
PackageArtifactFilter.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 102 lines
1 <?php
2 /**
3 * This file is part of PDepend.
4 *
5 * PHP Version 5
6 *
7 * Copyright (c) 2008-2015, Manuel Pichler <mapi@pdepend.org>.
38 *
39 * @copyright 2008-2015 Manuel Pichler. All rights reserved.
40 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
41 */
52 *
53 * @copyright 2008-2015 Manuel Pichler. All rights reserved.
54 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
55 */
56 class PackageArtifactFilter implements ArtifactFilter
walkthrough_test.php (https://bitbucket.org/moodle/moodle.git) PHP · 90 lines
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
23 global $CFG;
24 require_once(__DIR__ . '/../../../engine/lib.php');
25 require_once(__DIR__ . '/../../../engine/tests/helpers.php');
82 $this->check_current_mark(null);
83 $this->check_current_output(
84 new \question_pattern_expectation('/' . preg_quote('Not good enough!', '/') . '/'));
86 // Check that trying to process a manual comment with a grade causes an exception.
sfValidatorDateTest.php (https://github.com/proyectoalba/alba.git) PHP · 218 lines
1 <?php
3 /*
9 */
11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php');
13 $t = new lime_test(45, new lime_output_color());
99 {
100 $t->pass('->clean() throws a sfValidatorError if the date does not match the regex');
101 $t->like($e->getMessage(), '/'.preg_quote(htmlspecialchars($v->getOption('date_format'), ENT_QUOTES, 'UTF-8'), '/').'/', '->clean() returns the expected date format in the error message');
102 $t->is($e->getCode(), 'bad_format', '->clean() throws a sfValidatorError');
103 }
111 catch (sfValidatorError $e)
112 {
113 $t->like($e->getMessage(), '/'.preg_quote('dd/mm/YYYY', '/').'/', '->clean() returns the expected date format error if provided');
114 }
IncludePathLoader.php (https://github.com/agamba/place.web.git) PHP · 139 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: IncludePathLoader.php 23775 2011-03-01 17:25:24Z ralph $
21 */
24 * @see Zend_Tool_Framework_Loader_Abstract
25 */
26 require_once 'Zend/Tool/Framework/Loader/Abstract.php';
28 /**
29 * @see Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator
30 */
31 require_once 'Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php';
33 /**
S3EndpointMiddleware.php (https://github.com/trob/fabrik.git) PHP · 337 lines
tinyTemplate.php (https://github.com/dounokouno/TransmitMail.git) PHP · 318 lines
1 <?php
2 /*--------------------------------------------------------------*\
3 Description: HTML template class based on bTemplate.
117 // Process the includes
118 $regex = '/' . preg_quote($this->ldelim, '/') . 'include:(.*)' . preg_quote($this->rdelim, '/') . '/';
119 preg_match_all($regex, $contents, $matches);
120 foreach ($matches[1] as $index => $value) {
304 $regex_start = '/' . preg_quote($this->BAldelim, '/');
305 $regex_middle = '.*?' . preg_quote($this->BArdelim, '/') . '.*?' . preg_quote($this->EAldelim, '/');
306 $regex_end = '.*?' . preg_quote($this->EArdelim, '/') . '/s';
310 $contents = preg_replace($regex, '', $contents);
311 }
312 $regex = '/' . preg_quote($this->ldelim, '/') . '\$.*?' . preg_quote($this->rdelim, '/') . '/';
313 $contents = preg_replace($regex, '', $contents);
lib.php (https://gitlab.com/MotoSport/morgue) PHP · 132 lines
class-rewrite.php (https://bitbucket.org/joelkriteman/argento.git) PHP · 142 lines
1 <?php
2 /**
3 * @package Frontend
69 $category_base .= '/';
71 return preg_replace( '`' . preg_quote( $category_base, '`' ) . '`u', '', $link, 1 );
72 }
124 $category_nicename = get_category_parents( $category->parent, false, '/', true ) . $category_nicename;
126 $category_rewrite[$blog_prefix . '(' . $category_nicename . ')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
127 $category_rewrite[$blog_prefix . '(' . $category_nicename . ')/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
128 $category_rewrite[$blog_prefix . '(' . $category_nicename . ')/?$'] = 'index.php?category_name=$matches[1]';
129 }
Tiarra.php (https://github.com/tyoro/tiarraMetro.git) PHP · 253 lines
1 <?php
2 /**
3 * Net_Socket_Tiarra
5 * Using socket of tiarra to send message.
6 *
7 * PHP version 5
8 *
9 * The MIT License
26 * @license http://openpear.org/package/Net_Socket_Tiarra
27 * @version SVN: $Id$
28 * @link http://pear.php.net/package/Net_Socket_Tiarra
29 */
32 require_once 'Net/Socket/Tiarra/Exception.php';
34 /**
PageConstraint.php (https://gitlab.com/Shahriar_Rabbi/Test_Laravel) PHP · 124 lines
1 <?php
3 namespace Illuminate\Foundation\Testing\Constraints;
5 use PHPUnit_Framework_Constraint;
6 use Symfony\Component\DomCrawler\Crawler;
7 use SebastianBergmann\Comparator\ComparisonFailure;
8 use PHPUnit_Framework_ExpectationFailedException as FailedExpection;
10 abstract class PageConstraint extends PHPUnit_Framework_Constraint
51 protected function getEscapedPattern($text)
52 {
53 $rawPattern = preg_quote($text, '/');
55 $escapedPattern = preg_quote(e($text), '/');
base.php (https://bitbucket.org/ke2083/transfans.co.uk-website.git) PHP · 176 lines
1 <?php
2 /**
3 * @package Joomla.Platform
38 {
39 // Sanitize and explode the pattern.
40 $pattern = explode('/', trim(parse_url((string) $pattern, PHP_URL_PATH), ' /'));
42 // Prepare the route variables
63 elseif ($segment[0] == '\\' && $segment[1] == '*')
64 {
65 $regex[] = '\*' . preg_quote(substr($segment, 2));
66 }
67 // Match an unnamed variable without capture.
79 elseif ($segment[0] == '\\' && $segment[1] == ':')
80 {
81 $regex[] = preg_quote(substr($segment, 1));
82 }
83 // Match the standard segment.
AdvancedValueBinder.php (https://github.com/markn86/moodle.git) PHP · 174 lines
1 <?php
3 namespace PhpOffice\PhpSpreadsheet\Cell;
5 use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
6 use PhpOffice\PhpSpreadsheet\RichText\RichText;
7 use PhpOffice\PhpSpreadsheet\Shared\Date;
8 use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
9 use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
92 $decimalSeparator = StringHelper::getDecimalSeparator();
93 $thousandsSeparator = StringHelper::getThousandsSeparator();
94 if (preg_match('/^' . preg_quote($currencyCode, '/') . ' *(\d{1,3}(' . preg_quote($thousandsSeparator, '/') . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator, '/') . '\d{2})?$/', $value)) {
95 // Convert value to number
96 $value = (float) trim(str_replace([$currencyCode, $thousandsSeparator, $decimalSeparator], ['', '', '.'], $value));
CacheApc.php (https://gitlab.com/A.Julien/sendstockbymail-module-prestashop) PHP · 165 lines
1 <?php
2 /*
3 * 2007-2016 PrestaShop
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
21 * @author PrestaShop SA <contact@prestashop.com>
22 * @copyright 2007-2016 PrestaShop SA
23 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24 * International Registered Trademark & Property of PrestaShop SA
25 */
63 else
64 {
65 $pattern = str_replace('\\*', '.*', preg_quote($key));
67 $cache_info = apc_cache_info((extension_loaded('apcu') === true) ? '' : 'user');
testwalkthrough.php (https://github.com/DeanLennard/Moodle-Question-Engine-2.git) PHP · 149 lines
1 <?php
3 // This file is part of Moodle - http://moodle.org/
29 defined('MOODLE_INTERNAL') || die();
31 require_once($CFG->dirroot . '/question/engine/simpletest/helpers.php');
32 require_once($CFG->dirroot . '/question/type/gapselect/simpletest/helper.php');
101 $this->get_contains_try_again_button_expectation(true),
102 $this->get_does_not_contain_correctness_expectation(),
103 new PatternExpectation('/' . preg_quote(get_string('notcomplete', 'qbehaviour_interactive')) . '/'),
104 $this->get_contains_hint_expectation('This is the first hint'));
string.php (https://github.com/raeldc/nooku-server.git) PHP · 153 lines
Common.php (https://github.com/visor/nano.git) PHP · 307 lines
FiltersMatcher.php (https://gitlab.com/johanlindberg/irvato-crm) PHP · 120 lines
LogicalNot.php (https://gitlab.com/madwanz64/laravel) PHP · 136 lines
1 <?php declare(strict_types=1);
2 /*
3 * This file is part of PHPUnit.
4 *
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10 namespace PHPUnit\Framework\Constraint;
12 use function array_map;
90 * Returns this operator's precedence.
91 *
92 * @see https://www.php.net/manual/en/language.operators.precedence.php
93 */
94 public function precedence(): int
sfWebDebugPanelPropel.class.php (https://bitbucket.org/sebastian_jaurena/todo.git) PHP · 146 lines
1 <?php
3 /*
17 * @subpackage debug
18 * @author Fabien Potencier <fabien.potencier@symfony-project.com>
19 * @version SVN: $Id: sfWebDebugPanelPropel.class.php 27284 2010-01-28 18:34:57Z Kris.Wallsmith $
20 */
21 class sfWebDebugPanelPropel extends sfWebDebugPanel
95 {
96 // is this a key-glue-value fragment ?
97 if (preg_match('/^(\w+)'.preg_quote($innerGlue, '/').'(.*)/', $part, $match))
98 {
99 $details[] = $part;
CurrencyFormat.php (https://github.com/zendframework/zend-i18n.git) PHP · 283 lines
1 <?php
2 /**
3 * @see https://github.com/zendframework/zend-i18n for the canonical source repository
68 if (! extension_loaded('intl')) {
69 throw new Exception\ExtensionNotLoadedException(sprintf(
70 '%s component requires the intl PHP extension',
71 __NAMESPACE__
72 ));
264 '/\%s\d+(\s?%s)?$/u',
265 $formatter->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL),
266 preg_quote($this->getCurrencySymbol($locale, $currencyCode), '/')
267 );
backuplib.php (https://github.com/galitush2005/RTL-BIDI-Hebrew-Moodle-Plugins.git) PHP · 85 lines
1 <?php
2 /**
3 * Backup routine for this format
4 *
5 * @author Jeff Graham
6 * @version $Id: backuplib.php,v 1.1 2009/12/21 01:00:28 michaelpenne Exp $
7 * @package format_page
8 **/
70 global $CFG;
72 $base = preg_quote($CFG->wwwroot,'/');
74 $search = "/(".$base."\/index.php\?page\=)([0-9]+)/";
75 $content = preg_replace($search, '$@COURSEFORMATFRONTPAGE*$2@$', $content);
77 $search = "/(".$base."\/course\/view.php\?id\=)([0-9]+)(\&|\&)page\=([0-9]+)/";
78 $content = preg_replace($search, '$@COURSEFORMATPAGE*$2*$4@$', $content);
sfProjectFreezeTask.class.php (https://github.com/proyectoalba/alba.git) PHP · 112 lines
1 <?php
3 /*
15 * @subpackage task
16 * @author Fabien Potencier <fabien.potencier@symfony-project.com>
17 * @version SVN: $Id: sfProjectFreezeTask.class.php 14421 2009-01-02 03:48:52Z Carl.Vondrick $
18 */
19 class sfProjectFreezeTask extends sfBaseTask
42 directory.
44 The task also changes [config/config.php|COMMENT] to switch to the
45 embedded symfony files.
46 EOF;
98 $config = sfConfig::get('sf_config_dir').'/ProjectConfiguration.class.php';
99 $content = file_get_contents($config);
100 $content = str_replace('<?php', "<?php\n\n# FROZEN_SF_LIB_DIR: $symfonyLibDir", $content);
101 $content = preg_replace('#(\'|")'.preg_quote($symfonyLibDir, '#').'#', "dirname(__FILE__).$1/../lib/symfony", $content);
base.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 236 lines
string.php (https://github.com/jizillon/phpzillon-browser.git) PHP · 114 lines
1 <?php
2 /* Licensed under the Apache License, Version 2.0
3 * See the LICENSE and NOTICE file for further information
106 if (strpos($pattern, '*') !== false) {
107 // Wildcard match
108 $pattern = str_replace('\\*', '.*', preg_quote($pattern));
109 return (preg_match('/' . $pattern . '/', $input) > 0);
110 } else {
form-tags-manager.php (https://github.com/livinglab/openlab.git) PHP · 380 lines
AddAnnotatedClassesToCachePass.php (https://github.com/FabienD/symfony.git) PHP · 146 lines
Config.php (https://bitbucket.org/webpolis/liiv.git) PHP · 514 lines
1 <?php
2 /*
3 * CKFinder
21 * Include access control config class
22 */
23 require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/AccessControlConfig.php";
24 /**
25 * Include resource type config class
26 */
27 require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/ResourceTypeConfig.php";
28 /**
29 * Include thumbnails config class
30 */
31 require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/ThumbnailsConfig.php";
32 /**
33 * Include thumbnails config class
ArticleHTMLGalley.inc.php (https://github.com/mcrider/pkpUpgradeTestSuite.git) PHP · 185 lines
1 <?php
3 /**
4 * ArticleHTMLGalley.inc.php
5 *
6 * Copyright (c) 2003-2006 John Willinsky
12 * An HTML galley may include an optional stylesheet and set of images.
13 *
14 * $Id: ArticleHTMLGalley.inc.php,v 1.12 2006/06/12 23:25:48 alec Exp $
15 */
51 $imageUrl = Request::url(null, 'article', 'viewFile', array($this->getArticleId(), $this->getGalleyId(), $image->getFileId()));
52 $contents = preg_replace(
53 '/[Ss][Rr][Cc]\s*=\s*"([^"]*' . preg_quote($image->getOriginalFileName()) . ')"/',
54 'src="' . $imageUrl . '"',
55 $contents,
smarty_internal_resource_extends.php (https://bitbucket.org/thomashii/vtigercrm-6-for-postgresql.git) PHP · 148 lines
1 <?php
2 /**
3 * Smarty Internal Plugin Resource Extends
33 foreach ($components as $component) {
34 $s = Smarty_Resource::source(null, $source->smarty, $component);
35 if ($s->type == 'php') {
36 throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");
37 }
80 }
82 $_rdl = preg_quote($source->smarty->right_delimiter);
83 $_ldl = preg_quote($source->smarty->left_delimiter);
Comment.php (https://gitlab.com/x33n/PHP-Parser) PHP · 119 lines
1 <?php
3 namespace PhpParser;
100 // */ on all lines. So if the last line is " */", then " " is removed at the
101 // start of all lines.
102 return preg_replace('(^' . preg_quote($matches[1]) . ')m', '', $text);
103 } elseif (preg_match('(^/\*\*?\s*(?!\s))', $text, $matches)) {
104 // Multi line comment of the type
UriResolver.php (https://bitbucket.org/netglue/zf2-require-ssl-module.git) PHP · 270 lines
1 <?php
2 /**
3 * URI Resolver Service mostly helps us to figure out the corresponding http/s uri for a given request
259 protected function isUriMatch($path, array $patterns) {
260 foreach($patterns as $pattern) {
261 $pattern = '/^'.preg_quote($pattern, '/').'/';
262 if(preg_match($pattern, $path)) {
263 return true;
Poll.php (https://github.com/edbull/custard.git) PHP · 245 lines
1 <?php
2 /**
3 * Magento
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
22 * @package Mage_Poll
23 * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25 */
186 foreach ($this->getCookie()->get() as $cookieName => $cookieValue) {
187 $pattern = '#^' . preg_quote($this->_pollCookieDefaultName, '#') . '(\d+)$#';
188 $match = array();
189 if (preg_match($pattern, $cookieName, $match)) {
SetCookie.php (https://gitlab.com/x33n/respond) PHP · 373 lines
mail_sender.php (https://github.com/geekbuntu/Microweber.git) PHP · 137 lines
1 <?php /**
2 * Multibyte safe version of trim()
3 * Always strips whitespace characters (those equal to \s)
4 *
5 * @author Peter Johnson
6 * @email phpnet@rcpt.at
7 * @param $string The string to trim
8 * @param $chars Optional list of chars to remove from the string ( as per trim() )
9 * @param $chars_array Optional array of preg_quote'd chars to be removed
10 * @return string
11 */
12 function mb_trim( $string, $chars = "", $chars_array = array() )
13 {
14 for( $x=0; $x<iconv_strlen( $chars ); $x++ ) $chars_array[] = preg_quote( iconv_substr( $chars, $x, 1 ) );
15 $encoded_char_list = implode( "|", array_merge( array( "\s","\t","\n","\r", "\0", "\x0B" ), $chars_array ) );
question.php (https://github.com/burningTyger/os_moodle.git) PHP · 142 lines
AllTests.php (https://github.com/ewandor/horde.git) PHP · 151 lines
17 }
19 require_once 'PHPUnit/Autoload.php';
21 /**
77 self::setup();
79 $suite = new PHPUnit_Framework_TestSuite('Horde Framework - ' . self::$_package);
81 $basedir = dirname(self::$_file);
82 $baseregexp = preg_quote($basedir . DIRECTORY_SEPARATOR, '/');
84 foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
113 * E_STRICT and pull in Horde/Test/Autoload.php as autoloading
114 * definition. If there is an Autoload.php alongside the AllTests.php
115 * represented by self::$_file, then only this file will be used.
116 *
testquestion.php (https://github.com/colchambers/Moodle-Question-Engine-2.git) PHP · 177 lines
1 <?php
3 // This file is part of Moodle - http://moodle.org/
25 */
27 require_once($CFG->dirroot . '/question/engine/simpletest/helpers.php');
128 $match->init_first_step(new question_attempt_step());
129 $qsummary = $match->get_question_summary();
130 $this->assertPattern('/' . preg_quote($match->questiontext) . '/', $qsummary);
131 foreach ($match->stems as $stem) {
132 $this->assertPattern('/' . preg_quote($stem) . '/', $qsummary);
133 }
134 foreach ($match->choices as $choice) {
135 $this->assertPattern('/' . preg_quote($choice) . '/', $qsummary);
136 }
137 }
SaveZoneFile.php (https://bitbucket.org/droidzone/dns-manager.git) PHP · 183 lines
robots.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 92 lines
1 <?php
2 //$lang = "meta";
3 define( "MEDIAWIKI", true );
4 #include_once("CommonSettings.php");
5 #include_once("/apache/common/wmf-deployment/includes/ProfileStub.php" );
6 #include_once("/apache/common/wmf-deployment/includes/Defines.php" );
7 #include_once("/apache/common/wmf-deployment/wmf-config/CommonSettings.php");
8 #include_once("Setup.php");
10 include "/apache/common/live-1.5/MWVersion.php";
11 include getMediaWiki("includes/WebStart.php");
13 // determine language code
DumpReader.php (https://github.com/adamwight/wikipedia-offline-patch.git) PHP · 135 lines
1 <?php
2 class DumpReader
3 {
27 $matches = array();
28 $all_chunk_data = self::load_bz($file_name);
29 if (preg_match("/<title>".preg_quote($title, '/')."<\/title>.*?<text[^>]*>(.*)/s",
30 $all_chunk_data, $matches))
31 {
78 try {
79 require_once("xapian.php");
80 global $wgOfflineWikiPath;
81 $db = new XapianDatabase("$wgOfflineWikiPath/db");
member_output.class.php (https://github.com/hxzyzz/ddc.git) PHP · 176 lines
1 <?php
2 class member_output {
3 var $fields;
51 //TODO
52 $linkdatas = array(
53 0 => array(0=>'��վ',1=>'http://www.phpip.com'),
54 1 => array(0=>'°Ù¶È',1=>'http://www.baidu.com'),
55 );
59 foreach($linkdatas as $v) {
60 if($link_mode && $keywords) {
61 $word1[] = '/'.preg_quote($v, '/').'/';
62 $word2[] = $v;
63 $replacement[] = '<a href="javascript:;" onclick="show_ajax(this)" class="keylink">'.$v.'</a>';
64 } else {
65 $word1[] = '/'.preg_quote($v[0], '/').'/';
66 $word2[] = $v[0];
ruris-sp.inc.php (https://gitlab.com/Gashler/sg) PHP · 75 lines
1 <?php
2 /**
3 * s2Member's URI protection routines *(for specific URIs)*.
53 $user = (is_user_logged_in() && is_object($user = wp_get_current_user()) && !empty($user->ID)) ? $user : FALSE; // Current User's object.
55 if($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_redirection_override'] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri($user, 'root-returns-false')) && preg_match('/^'.preg_quote($login_redirection_uri, '/').'$/'.$ci, $uri) && (!$check_user || !$user || !$user->has_cap('access_s2member_level0')))
56 return apply_filters('ws_plugin__s2member_check_specific_ruri_level_access', array('s2member_level_req' => 0), get_defined_vars());
64 foreach(preg_split('/['."\r\n\t".']+/', c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars($GLOBALS['WS_PLUGIN__']['s2member']['o']['level'.$n.'_ruris'], $user)) as $str)
65 if($str && preg_match('/'.preg_quote($str, '/').'/'.$ci, $uri) && (!$check_user || !$user || !$user->has_cap('access_s2member_level'.$n)))
66 return apply_filters('ws_plugin__s2member_check_specific_ruri_level_access', array('s2member_level_req' => $n), get_defined_vars());
67 }
defaultable.php (https://github.com/asecondwill/syrup.git) PHP · 122 lines
1 <?php
2 class DefaultableBehavior extends ModelBehavior {
3 /**
54 foreach($fields as $field) {
55 if (
56 preg_match('/^((not|or)\.)?' . preg_quote($field) . '/i', $condition) ||
57 preg_match('/^((not|or)\.)?' . preg_quote($model->alias . '.' . $field) . '/i', $condition) ||
58 preg_match('/[^A-Z0-9_]+' . preg_quote($field) . '[^A-Z0-9_]+/i', $condition) ||
59 preg_match('/[^A-Z0-9_]+' . preg_quote($model->alias . '.' . $field) . '[^A-Z0-9_]+/i', $condition)
MaterializedPathRepository.php (https://bitbucket.org/iiic/iszp.git) PHP · 210 lines
1 <?php
3 namespace Gedmo\Tree\Document\MongoDB\Repository;
18 * @subpackage MaterializedPathRepository
19 * @link http://www.gediminasm.org
20 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
21 */
22 class MaterializedPathRepository extends AbstractTreeRepository
115 $meta = $this->getClassMetadata();
116 $config = $this->listener->getConfiguration($this->dm, $meta->name);
117 $separator = preg_quote($config['path_separator']);
118 $qb = $this->dm->createQueryBuilder()
119 ->find($meta->name);
122 if (is_object($node) && $node instanceof $meta->name) {
123 $node = new MongoDocumentWrapper($node, $this->dm);
124 $nodePath = preg_quote($node->getPropertyValue($config['path']));
126 if ($direct) {
string_helper.php (https://github.com/omaryak/seaforium.git) PHP · 310 lines
1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
127 * except those found in http://
128 *
129 * http://www.some-site.com//index.php
130 *
131 * becomes:
132 *
133 * http://www.some-site.com/index.php
134 *
135 * @access public
Baseurl.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 219 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
138 private function _assertStartsWithValuesOrUrl(array $values, $value)
139 {
140 $quoted = array_map('preg_quote', $values, array_fill(0, count($values), '/'));
141 if (!preg_match('/^(' . implode('|', $quoted) . ')(.+\/)?$/', $value) && !$this->_isFullyQualifiedUrl($value)
142 ) {
SeparatorToSeparator.php (https://bitbucket.org/Ebozavrik/test-application.git) PHP · 137 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: SeparatorToSeparator.php 24593 2012-01-05 20:35:02Z matthew $
20 */
23 * @see Zend_Filter_PregReplace
24 */
25 require_once 'Zend/Filter/PregReplace.php';
27 /**
125 {
126 if ($this->_searchSeparator == null) {
127 require_once 'Zend/Filter/Exception.php';
128 throw new Zend_Filter_Exception( 'You must provide a search separator for this filter to work.' );
129 }
Format.php (https://gitlab.com/jjpa2018/dashboard) PHP · 279 lines
1 <?php
3 namespace PhpOffice\PhpSpreadsheet\Calculation\TextData;
5 use DateTimeInterface;
6 use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
7 use PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel;
8 use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcExp;
9 use PhpOffice\PhpSpreadsheet\Calculation\Functions;
10 use PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
11 use PhpOffice\PhpSpreadsheet\Shared\Date;
bp-core-wpabstraction.php (https://github.com/jazbek/nycga2.git) PHP · 162 lines
1 <?php
2 /*****
3 * WordPress Abstraction
84 * Multibyte encoding fallback functions
85 *
86 * The PHP multibyte encoding extension is not enabled by default. In cases where it is not enabled,
87 * these functions provide a fallback.
88 *
123 */
124 function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
125 $needle = preg_quote( $needle, '/' );
127 $ar = array();
146 */
147 function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
148 $needle = preg_quote( $needle, '/' );
150 $ar = array();
string_helper.php (https://github.com/bwghughes/houghandco.git) PHP · 271 lines
1 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
127 * except those found in http://
128 *
129 * http://www.some-site.com//index.php
130 *
131 * becomes:
132 *
133 * http://www.some-site.com/index.php
134 *
135 * @access public
uri.php (https://gitlab.com/Ltaimao/wecenter) PHP · 319 lines
1 <?php
2 /*
3 +--------------------------------------------------------------------------
68 if (count($requests) == 1 AND dirname($_SERVER['SCRIPT_NAME']) != '/')
69 {
70 $request_main = preg_replace('/^' . preg_quote(dirname($_SERVER['SCRIPT_NAME']), '/') . '/i', '', $request_main);
71 }
72 else if (count($requests) == 2)
94 }
96 if (strstr($base_script, '.php'))
97 {
98 $request_main = str_replace($base_script . '/', '', $request_main);
205 $__app_dir = $uri['first']['args'][0] ? $uri['first']['args'][0] : $this->default_vars['app_dir']; // 应用目录
207 if (file_exists(ROOT_PATH . 'app/' . $__app_dir . '/' . $uri['first']['args'][1] . '.php'))
208 {
209 $this->controller = $uri['first']['args'][1]; // 控制器
view.php (https://gitlab.com/theinfra/equatroLMS) PHP · 220 lines
1 <?php
3 class CLASS_VIEW {
75 $panelView = APP_BASE_PATH.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'Panels'.DIRECTORY_SEPARATOR.$PanelId.'.tpl';
76 $panelLogic = APP_BASE_PATH.DIRECTORY_SEPARATOR.'display'.DIRECTORY_SEPARATOR.'panel.'.$PanelId.'.php';
77 include_once(APP_BASE_PATH.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'panel.php');
79 if (file_exists ( $panelLogic )) {
80 $panelClass = strtoupper('PANEL_'.$PanelId);
81 // Parse the PHP panel if it exists
82 include_once ($panelLogic);
83 $objPanel = new $panelClass ();
114 $output = $text;
116 preg_match_all('/(?siU)(%%'.preg_quote($prefix).'[a-zA-Z0-9_\.]+%%)/', $text, $matches);
118 foreach ($matches[0] as $key => $k) {
class-wc-shipping-local-pickup.php (https://gitlab.com/webkod3r/tripolis) PHP · 201 lines
check_paths_inc.php (https://github.com/fusenigk/mantisbt-1.git) PHP · 131 lines
1 <?php
2 # MantisBT - A PHP based bugtracking system
21 * @link http://www.mantisbt.org
22 *
23 * @uses check_api.php
24 * @uses config_api.php
32 * MantisBT Check API
33 */
34 require_once( 'check_api.php' );
35 require_api( 'config_api.php' );
82 if( $t_paths['absolute_path']['real_path'] !== false ) {
83 $t_absolute_path_regex_safe = preg_quote( $t_paths['absolute_path']['real_path'], '/' );
84 } else {
85 $t_absolute_path_regex_safe = preg_quote( $t_paths['absolute_path']['config_value'], '/' );
UnusedUseFixer.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 240 lines
walkthrough_test.php (https://github.com/andreev-artem/moodle.git) PHP · 156 lines
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
28 global $CFG;
29 require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
48 if ($content) {
49 $this->assertRegExp('/' . preg_quote(s($content), '/') . '/', $this->currentoutput);
50 }
51 }
97 $this->check_current_mark(null);
98 $this->render();
99 $this->assertRegExp('/' . preg_quote($response, '/') . '/', $this->currentoutput);
100 $this->check_current_output(
101 $this->get_contains_question_text_expectation($q),
CacheMemcached.php (https://gitlab.com/staging06/myproject) PHP · 242 lines
1 <?php
2 /*
3 * 2007-2015 PrestaShop
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
21 * @author PrestaShop SA <contact@prestashop.com>
22 * @copyright 2007-2015 PrestaShop SA
23 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24 * International Registered Trademark & Property of PrestaShop SA
25 */
186 else
187 {
188 $pattern = str_replace('\\*', '.*', preg_quote($key));
189 $keys = $this->memcached->getAllKeys();
190 foreach ($keys as $key => $data)
IncludePathLoader.php (https://github.com/ftaiolivista/Zend-Framework-Namespaced-.git) PHP · 144 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: IncludePathLoader.php 20904 2010-02-04 16:18:18Z matthew $
21 */
29 * @see Zend_Tool_Framework_Loader_Abstract
30 */
31 require_once 'Zend/Tool/Framework/Loader/Abstract.php';
33 /**
34 * @see Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator
35 */
36 require_once 'Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php';
38 /**
User_agent.php (https://gitlab.com/zanderwong/admin) PHP · 486 lines
1 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 5.1.6 or newer
6 *
7 * @package CodeIgniter
80 */
81 private function _load_agent_file() {
82 if (defined('ENVIRONMENT') AND is_file(APPPATH . 'config/' . ENVIRONMENT . '/user_agents.php')) {
83 include(APPPATH . 'config/' . ENVIRONMENT . '/user_agents.php');
84 } elseif (is_file(APPPATH . 'config/user_agents.php')) {
85 include(APPPATH . 'config/user_agents.php');
backup_lesson_activity_task.class.php (https://bitbucket.org/kudutest1/moodlegit.git) PHP · 111 lines
1 <?php
3 // This file is part of Moodle - http://moodle.org/
27 defined('MOODLE_INTERNAL') || die();
29 require_once($CFG->dirroot . '/mod/lesson/backup/moodle2/backup_lesson_stepslib.php');
31 /**
59 global $CFG;
61 $base = preg_quote($CFG->wwwroot.'/mod/lesson','#');
63 // Provides the interface for overall authoring of lessons
64 $pattern = '#'.$base.'/edit\.php\?id=([0-9]+)#';
65 $replacement = '$@LESSONEDIT*$1@$';
66 $content = preg_replace($pattern, $replacement, $content);
publishable.php (https://github.com/ciudadanointeligente/votainteligente.com.ar.git) PHP · 265 lines
1 <?php
2 /**
3 * Copyright 2007-2010, Cake Development Corporation (http://cakedc.com)
7 *
8 * @copyright Copyright 2007-2010, Cake Development Corporation (http://cakedc.com)
9 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
10 */
173 foreach($fields as $field) {
174 if (preg_match('/^' . preg_quote($field) . '[\s=!]+/i', $queryData['conditions']) ||
175 preg_match('/\\x20+' . preg_quote($field) . '[\s=!]+/i', $queryData['conditions'])) {
smarty_internal_resource_extends.php (https://github.com/ACCORD5/TrellisDesk.git) PHP · 186 lines
1 <?php
3 /**
17 {
18 $this->smarty = $smarty;
19 $this->_rdl = preg_quote($smarty->right_delimiter);
20 $this->_ldl = preg_quote($smarty->left_delimiter);
180 $_compile_dir .= DS;
181 }
182 return $_compile_dir . $_filepath . '.' . $_template->resource_type . '.' . basename($_files[count($_files)-1]) . $_cache . '.php';
183 }
184 }
plugin.php (https://github.com/bk-amahi/esoTalk.git) PHP · 127 lines
testwalkthrough.php (https://github.com/nigeldaley/moodle.git) PHP · 104 lines
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
27 defined('MOODLE_INTERNAL') || die();
29 require_once($CFG->dirroot . '/question/engine/simpletest/helpers.php');
85 $this->get_contains_validation_error_expectation(),
86 new PatternExpectation('/' .
87 preg_quote(get_string('invalidnumber', 'qtype_numerical') . '/')),
88 $this->get_does_not_contain_try_again_button_expectation(),
89 $this->get_no_hint_visible_expectation());
class-waf-operators.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 286 lines
smarty_internal_compile_extends.php (https://github.com/halka139/html-warrior.git) PHP · 113 lines
UrlMatcherTest.php (https://github.com/societies/SOCIETIES-Platform.git) PHP · 245 lines
1 <?php
3 /*
19 use Symfony\Component\Routing\RequestContext;
21 class UrlMatcherTest extends \PHPUnit_Framework_TestCase
22 {
23 public function testNoMethodSoAllowed()
163 $collection = new RouteCollection();
164 $chars = '!"$%éà &\'()*+,./:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[]^_`abcdefghijklmnopqrstuvwxyz{|}~-';
165 $collection->add('foo', new Route('/{foo}/bar', array(), array('foo' => '['.preg_quote($chars).']+')));
167 $matcher = new UrlMatcher($collection, new RequestContext());
StringMatches.php (https://github.com/joac/sugarcrm_dev.git) PHP · 140 lines
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 * @package PHPUnit
38 * @subpackage Framework_Constraint
39 * @author Sebastian Bergmann <sebastian@phpunit.de>
47 * ...
48 *
49 * @package PHPUnit
50 * @subpackage Framework_Constraint
51 * @author Sebastian Bergmann <sebastian@phpunit.de>
52 * @copyright 2002-2011 Sebastian Bergmann <sebastian@phpunit.de>
53 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
54 * @version Release: 3.5.14
55 * @link http://www.phpunit.de/
56 * @since Class available since Release 3.5.0
57 */
58 class PHPUnit_Framework_Constraint_StringMatches extends PHPUnit_Framework_Constraint_PCREMatch
59 {
60 /**
Parser.php (https://github.com/dchill42/CodeIgniter.git) PHP · 231 lines
1 <?php
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 5.2.4 or newer
6 *
7 * NOTICE OF LICENSE
221 protected function _match_pair($string, $variable)
222 {
223 return preg_match('|'.preg_quote($this->l_delim).$variable.preg_quote($this->r_delim).'(.+?)'.preg_quote($this->l_delim).'/'.$variable.preg_quote($this->r_delim).'|s',
224 $string, $match)
225 ? $match : FALSE;
228 }
230 /* End of file Parser.php */
231 /* Location: ./system/libraries/Parser.php */
wpmdb-replace.php (https://gitlab.com/haque.mdmanzurul/wp-harpar-carolyn) PHP · 213 lines
1 <?php
3 final class WPMDB_Replace {
47 }
49 $pattern = '|//(.*?)\\.' . preg_quote( $this->wpmdb->get_domain_current_site(), '|' ) . '|';
50 $replacement = '//$1.' . trim( $domain_replace );
51 $new = preg_replace( $pattern, $replacement, $new );
92 try {
93 if ( is_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) {
94 // PHP currently has a bug that doesn't allow you to clone the DateInterval / DatePeriod classes.
95 // We skip them here as they probably won't need data to be replaced anyway
96 if ( is_object( $unserialized ) ) {
StringMatches.php (https://github.com/quinta/qcodo.git) PHP · 140 lines
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 * @package PHPUnit
38 * @subpackage Framework_Constraint
39 * @author Sebastian Bergmann <sebastian@phpunit.de>
47 * ...
48 *
49 * @package PHPUnit
50 * @subpackage Framework_Constraint
51 * @author Sebastian Bergmann <sebastian@phpunit.de>
52 * @copyright 2002-2011 Sebastian Bergmann <sebastian@phpunit.de>
53 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
54 * @version Release: 3.5.15
55 * @link http://www.phpunit.de/
56 * @since Class available since Release 3.5.0
57 */
58 class PHPUnit_Framework_Constraint_StringMatches extends PHPUnit_Framework_Constraint_PCREMatch
59 {
60 /**
Text.php (https://bitbucket.org/dbaltas/zend-framework-1.x-on-git.git) PHP · 213 lines
question_test.php (https://bitbucket.org/moodle/moodle.git) PHP · 150 lines
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
24 global $CFG;
25 require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
128 $question->start_attempt(new question_attempt_step(), 1);
129 $qsummary = $question->get_question_summary();
130 $this->assertMatchesRegularExpression('/' . preg_quote($question->questiontext, '/') . '/', $qsummary);
131 foreach ($question->stems as $stem) {
132 $this->assertMatchesRegularExpression('/' . preg_quote($stem, '/') . '/', $qsummary);
133 }
134 foreach ($question->choices as $choice) {
135 $this->assertMatchesRegularExpression('/' . preg_quote($choice, '/') . '/', $qsummary);
136 }
137 }
StringMatches.php (https://github.com/quimateur/SIFO.git) PHP · 140 lines
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 * @package PHPUnit
38 * @subpackage Framework_Constraint
39 * @author Sebastian Bergmann <sebastian@phpunit.de>
47 * ...
48 *
49 * @package PHPUnit
50 * @subpackage Framework_Constraint
51 * @author Sebastian Bergmann <sebastian@phpunit.de>
52 * @copyright 2002-2011 Sebastian Bergmann <sebastian@phpunit.de>
53 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
54 * @version Release: 3.5.13
55 * @link http://www.phpunit.de/
56 * @since Class available since Release 3.5.0
57 */
58 class PHPUnit_Framework_Constraint_StringMatches extends PHPUnit_Framework_Constraint_PCREMatch
59 {
60 /**
theme.php (https://github.com/ophian/gallery3.git) PHP · 113 lines
1 <?php defined("SYSPATH") or die("No direct script access.");
2 /**
3 * Gallery - a web based photo album viewer and editor
46 // PATH_INFO here so we need to strip it off manually
47 if ($suffix = Kohana::config("core.url_suffix")) {
48 $path = preg_replace("#" . preg_quote($suffix) . "$#u", "", $path);
49 }
preg.h (https://gitlab.com/iranjith4/hhvm) C Header · 149 lines
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 */
catgs-sp.inc.php (https://gitlab.com/Gashler/dp) PHP · 89 lines
1 <?php
2 /**
3 * s2Member's Category protection routines *(for specific Categories)*.
52 $user = /* Current User's object. */(is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false;
54 if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $cat_uri) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level0")))
55 return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", array ("s2member_level_req" => 0), get_defined_vars ());
77 foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
78 if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $cat_uri) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
79 return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
80 }
rule.php (https://github.com/elleeott/WPOC-boilerplate.git) PHP · 239 lines
1 <?php
3 /**
221 */
222 function w3_erase_rules($rules, $start, $end) {
223 $rules = preg_replace('~' . w3_preg_quote($start) . "\n.*?" . w3_preg_quote($end) . "\n*~s", '', $rules);
224 $rules = w3_trim_rules($rules);
236 */
237 function w3_has_rules($rules, $start, $end) {
238 return preg_match('~' . w3_preg_quote($start) . "\n.*?" . w3_preg_quote($end) . "\n*~s", $rules);
239 }
CacheMemcached.php (https://gitlab.com/A.Julien/sendstockbymail-module-prestashop) PHP · 242 lines
1 <?php
2 /*
3 * 2007-2016 PrestaShop
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
21 * @author PrestaShop SA <contact@prestashop.com>
22 * @copyright 2007-2016 PrestaShop SA
23 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24 * International Registered Trademark & Property of PrestaShop SA
25 */
186 else
187 {
188 $pattern = str_replace('\\*', '.*', preg_quote($key));
189 $keys = $this->memcached->getAllKeys();
190 foreach ($keys as $key => $data)
Class.UpdateAttributeStatus.php (https://github.com/CircleCode/dynacase-core.git) PHP · 155 lines
1 <?php
2 /*
3 * @author Anakeen
91 $lines = array();
92 foreach ($this->content as $line) {
93 if (preg_match(sprintf("/^[0-9T:-]{19} [\w-]* ?%s/u", preg_quote($code, "/")) , $line)) $lines[] = $line;
94 }
95 return $lines;
127 public function getResults()
128 {
129 $r = $this->getCodeLines("logStatusReport PHP");
130 if ($r) {
131 $pos = mb_strpos($r[0], ':', 20);
Base.php (https://github.com/jupeter/mysql-workbench-schema-exporter.git) PHP · 176 lines
Enumerator.php (https://gitlab.com/dzakiafif/cokelatklasik) PHP · 146 lines
ezincludefunctions.php (https://github.com/GunioRobot/ezpublish.git) PHP · 189 lines
1 <?php
2 /**
3 * @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
26 {
27 $name = strtolower( $name );
28 $include = "kernel/common/$name.php";
29 return include_once( $include );
30 }
38 {
39 $className = strtolower( $className );
40 $include = "kernel/classes/datatypes/$datatype/$className.php";
41 return include_once( $include );
42 }
44 /**
45 * Loose extension path function for include use originally from ezextension.php
46 *
47 * @deprecated Since 4.3
StringMatches.php (https://github.com/agallou/BehatCH.git) PHP · 140 lines
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 * @package PHPUnit
38 * @subpackage Framework_Constraint
39 * @author Sebastian Bergmann <sebastian@phpunit.de>
47 * ...
48 *
49 * @package PHPUnit
50 * @subpackage Framework_Constraint
51 * @author Sebastian Bergmann <sebastian@phpunit.de>
52 * @copyright 2002-2010 Sebastian Bergmann <sebastian@phpunit.de>
53 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
54 * @version Release: 3.5.3
55 * @link http://www.phpunit.de/
56 * @since Class available since Release 3.5.0
57 */
58 class PHPUnit_Framework_Constraint_StringMatches extends PHPUnit_Framework_Constraint_PCREMatch
59 {
60 /**
Edgard.php (https://bitbucket.org/pombredanne/spip-zone-treemap.git) PHP · 159 lines
1 <?php
2 /**
3 * Phergie
4 *
5 * PHP version 5
6 *
7 * LICENSE
43 public function onLoad()
44 {
45 $fp1 = file_get_contents("http://edgard.spip.net/spip.php?page=edgard&var_mode=recalcul");
46 $fp2 = file_get_contents("http://edgard.spip.net/spip.php?page=mafaq&var_mode=recalcul");
79 //commençons par (^#\d{2,4}\b);http://core.spip.org/issues/
80 $pattern = '/' . preg_quote($prefix) .
81 '\#([0-9]+)/iAD';
82 if (!$trouve AND preg_match($pattern, $text, $m)) {
IncludePathLoader.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 139 lines
1 <?php
2 /**
3 * Zend Framework
24 * @see Zend_Tool_Framework_Loader_Abstract
25 */
26 #require_once 'Zend/Tool/Framework/Loader/Abstract.php';
28 /**
29 * @see Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator
30 */
31 #require_once 'Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php';
33 /**
47 protected function _getFiles()
48 {
49 #require_once 'Zend/Loader.php';
50 $paths = Zend_Loader::explodeIncludePath();
class-rewrite.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 169 lines
1 <?php
2 /**
3 * @package Frontend
81 $category_base .= '/';
83 return preg_replace( '`' . preg_quote( $category_base, '`' ) . '`u', '', $link, 1 );
84 }
151 }
153 $category_rewrite[ $blog_prefix . '(' . $category_nicename . ')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$' ] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
154 $category_rewrite[ $blog_prefix . '(' . $category_nicename . ')/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$' ] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
155 $category_rewrite[ $blog_prefix . '(' . $category_nicename . ')/?$' ] = 'index.php?category_name=$matches[1]';
156 }
157 }
smarty_internal_compile_extends.php (https://gitlab.com/piotr-zuralski/demo-zuralski-trojmiastopl-articles) PHP · 90 lines
InterpolationScanner.php (https://github.com/welaika/wordless.git) PHP · 167 lines
1 <?php
3 /**
33 foreach ($this->interpolationChars as $name => list($start, $end)) {
34 $start = preg_quote($start, '/');
35 $end = preg_quote($end, '/');
44 $this->regExp = '(?<text>.*?)'.
45 '(?<!\\\\)'.
46 '(?<escape>#|!(?='.preg_quote($this->interpolationChars['interpolation'][0], '/').'))'.
47 '(?<wrap>'.implode('|', $interpolations).')';
48 }
ParserEngine.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 236 lines
1 <?php
2 /**
3 * Acts as the primary interface between the world and the parser.
61 }
62 if ($rule->nodeName == "Assignment" || $rule->nodeName == "Reference" || $rule->nodeName == "Text") {
63 $saveTags = str_replace("~r", preg_quote($replaceStr, "/"), $saveTags);
64 $newTags = $rule->getAttribute("saveTags");
65 if ($saveTags == "") {
76 if (! $foundTag) {
77 if ($rule->getAttribute("regex") != NULL) {
78 $tag = str_replace("~r", preg_quote($replaceStr, "/"), $tag);
79 $foundTag = preg_match("/^$tag/s", $text, $matches);
80 if ($foundTag) {
209 $childTags = $rule->getAttribute("tag");
210 if ($rule->getAttribute("regex") == NULL) {
211 $childTags = preg_quote($childTags, "/");
212 }
213 $failSafe = FALSE;
CacheClearCommand.php (https://github.com/flubbers/cloudFutbol.git) PHP · 170 lines
1 <?php
3 /*
43 and debug mode:
45 <info>php app/console cache:clear --env=dev</info>
46 <info>php app/console cache:clear --env=prod --no-debug</info>
100 // fix container files and classes
101 $regex = '/'.preg_quote($this->getTempKernelSuffix(), '/').'/';
102 $finder = new Finder();
103 foreach ($finder->files()->name(get_class($kernel->getContainer()).'*')->in($warmupDir) as $file) {
107 // fix absolute paths to the cache directory
108 $content = preg_replace('/'.preg_quote($warmupDir,'/').'/', preg_replace('/_new$/', '', $warmupDir), $content);
110 file_put_contents(preg_replace($regex, '', $file), $content);
Loader.php (https://github.com/rsky/makegood.git) PHP · 229 lines
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
4 /**
5 * PHP version 5
6 *
7 * Copyright (c) 2009-2010 KUBO Atsuhiro <kubo@iteman.jp>,
31 * @package Stagehand_Autoload
32 * @copyright 2009-2010 KUBO Atsuhiro <kubo@iteman.jp>
33 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
34 * @version Release: 1.1.0
35 * @since File available since Release 0.2.0
41 * @package Stagehand_Autoload
42 * @copyright 2009-2010 KUBO Atsuhiro <kubo@iteman.jp>
43 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
44 * @version Release: 1.1.0
45 * @since File available since Release 0.2.0
sfCache.class.php (https://github.com/frhumanes/PLM.git) PHP · 231 lines
1 <?php
3 /*
15 * @subpackage cache
16 * @author Fabien Potencier <fabien.potencier@symfony-project.com>
17 * @version SVN: $Id: sfCache.class.php 28842 2010-03-29 08:18:46Z fabien $
18 */
19 abstract class sfCache
223 $regexp = str_replace(
224 array('\\*\\*', '\\*'),
225 array('.+?', '[^'.preg_quote(sfCache::SEPARATOR, '#').']+'),
226 preg_quote($pattern, '#')
smarty_internal_compile_block.php (https://github.com/hatone/revolution.git) PHP · 181 lines
1 <?php
2 /**
3 * Smarty Internal Plugin Compile Block
47 static function saveBlockData($block_content, $block_tag, $template, $filepath)
48 {
49 $_rdl = preg_quote($template->smarty->right_delimiter);
50 $_ldl = preg_quote($template->smarty->left_delimiter);
116 $_tpl->suppressFileDependency = true;
117 if (strpos($compiler->template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
118 $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->parser->current_buffer->to_smarty_php(), $_tpl->getCompiledTemplate());
119 } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') {
120 $_output = $_tpl->getCompiledTemplate() . $compiler->parser->current_buffer->to_smarty_php();
121 } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') {
122 $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->getCompiledTemplate();
123 } elseif (!empty($compiler->template->block_data[$_name])) {
124 $_output = $_tpl->getCompiledTemplate();
backuplib.php (https://github.com/cgtaylor/moodle.git) PHP · 207 lines
1 <?php
3 require_once($CFG->dirroot . '/mod/lightboxgallery/lib.php');
154 global $CFG;
156 $base = preg_quote($CFG->wwwroot, '/');
158 $search = "/(".$base."\/mod\/lightboxgallery\/index.php\?id\=)([0-9]+)/";
159 $result = preg_replace($search, '$@GALLERYINDEX*$2@$', $content);
161 $search = "/(".$base."\/mod\/lightboxgallery\/view.php\?id\=)([0-9]+)/";
162 $result = preg_replace($search, '$@GALLERYVIEWBYID*$2@$', $result);
164 $search = "/(".$base."\/mod\/lightboxgallery\/view.php\?l\=)([0-9]+)/";
165 $result = preg_replace($search, '$@GALLERYVIEWBYL*$2@$', $result);
backuplib.php (https://github.com/nadavkav/RTL-BIDI-Hebrew-Moodle-Plugins.git) PHP · 207 lines
1 <?php
3 include($CFG->dirroot . '/mod/lightboxgallery/lib.php');
154 global $CFG;
156 $base = preg_quote($CFG->wwwroot, '/');
158 $search = "/(".$base."\/mod\/lightboxgallery\/index.php\?id\=)([0-9]+)/";
159 $result = preg_replace($search, '$@GALLERYINDEX*$2@$', $content);
161 $search = "/(".$base."\/mod\/lightboxgallery\/view.php\?id\=)([0-9]+)/";
162 $result = preg_replace($search, '$@GALLERYVIEWBYID*$2@$', $result);
164 $search = "/(".$base."\/mod\/lightboxgallery\/view.php\?l\=)([0-9]+)/";
165 $result = preg_replace($search, '$@GALLERYVIEWBYL*$2@$', $result);