PageRenderTime 238ms queryTime 30ms sortTime 5ms getByIdsTime 31ms findMatchingLines 64ms

100+ results results for 'php preg_replace' (238 ms)

Not the results you expected?
admin_ratings.php git://github.com/gallery/gallery3-contrib.git | PHP | 140 lines
                    
1<?php defined("SYSPATH") or die("No direct script access.");
                    
2/**
                    
47    $iconset = Input::instance()->post("iconset");
                    
48    $iconset = preg_replace("/\/index\.php/","",$iconset);
                    
49    module::set_var("ratings", "iconset", $iconset);
                    
                
compressor.php http://textmotion.googlecode.com/svn/trunk/ | PHP | 0 lines
                    
1<?php
                    
2
                    
17 * @lastmodified    $Date: 2008-05-26 14:32:25 +1000 (Mon, 26 May 2008) $
                    
18 * @license         http://www.opensource.org/licenses/mit-license.php The MIT License
                    
19 *
                    
91      // protecting from parent directory writing
                    
92      $current["filename"] = preg_replace("/(\.\.\/|\/\.\.)/", "", $current["filename"]);
                    
93
                    
                
TemplateTask.php git://github.com/hugodias/cakeStrap.git | PHP | 219 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP 5
                    
6 *
                    
6 *
                    
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
8 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
15 * @link          http://cakephp.org CakePHP(tm) Project
                    
16 * @since         CakePHP(tm) v 1.3
                    
16 * @since         CakePHP(tm) v 1.3
                    
17 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
                    
18 */
                    
72		$separator = DS === '/' ? '/' : '\\\\';
                    
73		$core = preg_replace('#shells' . $separator . '$#', '', $core);
                    
74
                    
                
caddchatm.php https://gitlab.com/ppkbb3cker/ppkbb3cker2.git | PHP | 235 lines
                    
1<?php
                    
2/**
                    
4* @package ppkBB3cker
                    
5* @version $Id: caddchatm.php 1.000 2010-03-14 13:14:00 PPK $
                    
6* @copyright (c) 2010 PPK
                    
6* @copyright (c) 2010 PPK
                    
7* @license http://opensource.org/licenses/gpl-license.php GNU Public License
                    
8*
                    
13*/
                    
14if (!defined('IN_PHPBB'))
                    
15{
                    
77								$edit_data['user_id'] > 1 ? '' : $edit_data['user_id']=1;
                    
78								include_once($phpbb_root_path.'chat/include/caddlogchat.'.$phpEx);
                    
79								chat_add_log(3, $chat_user['user_id'], my_int_val($edit_data['room']), mysql_real_escape_string($edit_data['user_id'], $c), 'LOG_CHAT_EDITMESS', '');
                    
118	// generates E_NOTICE
                    
119	// for PHP4 objects, but not PHP5 objects
                    
120	$str = (string) $str;
                    
                
links_options.php https://bitbucket.org/wiseintegration/wisetracker-wp.git | PHP | 184 lines
                    
1<?php
                    
2/**
                    
14	<div class="postbox">
                    
15		<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
                    
16		<h3 class="hndle" id="links_options"><?php esc_attr_e( 'Links options', 'adminimize' ); ?></h3>
                    
22				<colgroup>
                    
23					<?php
                    
24					$col = 0;
                    
32				<tr>
                    
33					<th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
                    
34					<?php
                    
35					foreach ( $user_roles_names as $role_name ) { ?>
                    
36						<th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
                    
37							echo '<br/>' . $role_name; ?></th>
                    
37							echo '<br/>' . $role_name; ?></th>
                    
38					<?php } ?>
                    
39				</tr>
                    
                
rss-importer.php https://bitbucket.org/babinkochana/triptrills.git | PHP | 227 lines
                    
1<?php
                    
2/*
                    
17// Load Importer API
                    
18require_once ABSPATH . 'wp-admin/includes/import.php';
                    
19
                    
20if ( !class_exists( 'WP_Importer' ) ) {
                    
21	$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
                    
22	if ( file_exists( $class_wp_importer ) )
                    
60		echo '<p>'.__('Howdy! This importer allows you to extract posts from an RSS 2.0 file into your WordPress site. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.', 'rss-importer').'</p>';
                    
61		wp_import_upload_form("admin.php?import=rss&amp;step=1");
                    
62		echo '</div>';
                    
90				preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date_gmt);
                    
91				$post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]);
                    
92				$post_date_gmt = str_replace('T', ' ', $post_date_gmt);
                    
128			// Clean up content
                    
129			$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
                    
130			$post_content = str_replace('<br>', '<br />', $post_content);
                    
                
cachevalidator.php https://gitlab.com/bechemm/opencaching.pl.git | PHP | 197 lines
                    
1<?php
                    
2$secret = "dupa231";
                    
2$secret = "dupa231";
                    
3include('commons.php');
                    
4header('Content-Type: application/xhtml+xml; charset=utf-8');
                    
68    <!--<span><a href="">Strona Główna</a></span>-->
                    
69            <?php
                    
70            include("menu.inc");
                    
74
                    
75            <?php
                    
76
                    
78            $text = $_POST['text'];
                    
79            //$text = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $text);
                    
80            #$text = preg_replace('~&#x([0-9a-fA-F]+);~ei', 'chr(hexdec("\\1"))', $text);
                    
83            //decode decimal HTML entities added by web browser
                    
84            $text = preg_replace('/&#\d{2,5};/ue', "utf8_entity_decode('$0')", $text );
                    
85            //decode hex HTML entities added by web browser
                    
                
field.php https://gitlab.com/redring-co-in/redring_website.git | PHP | 298 lines
                    
1<?php
                    
2/**
                    
196		if ( ! isset( $this->id ) ) {
                    
197			$this->id = isset( $this->name ) ? trim( preg_replace( '/[^a-zA-Z0-9\-_]+/', '_', $this->name ), '_' ) : null;
                    
198		}
                    
231		// Get path to template file
                    
232		$file = WR_CF_Loader::get_path( "form/field/tmpl/{$tpl}.php" );
                    
233
                    
234		if ( empty( $file ) ) {
                    
235			$file = WR_CF_Loader::get_path( 'form/field/tmpl/text.php' );
                    
236		}
                    
                
Filesystem.php https://bitbucket.org/leopublic/dataweb.git | PHP | 239 lines
                    
1<?php
                    
2
                    
214    {
                    
215        return preg_replace('#/{2,}#', '/', strtr((string) $name, '\\', '/'));
                    
216    }
                    
                
QueryBuilder.php https://bitbucket.org/vikaskr/event.git | PHP | 184 lines
                    
1<?php
                    
2/**
                    
114        $definition = $this->getColumnDefinition($table, $column);
                    
115        $definition = trim(preg_replace("/COMMENT '(.*?)'/i", '', $definition));
                    
116
                    
172        }
                    
173        $sql = preg_replace('/^[^(]+\((.*)\).*$/', '\1', $sql);
                    
174        $sql = str_replace(', [', ",\n[", $sql);
                    
                
user_agent.php http://scp-soft.googlecode.com/svn/trunk/ | PHP | 588 lines
                    
1<?php 
                    
2/**
                    
10 * @author		Rick Ellis
                    
11 * @link		http://kohanaphp.com/user_guide/libraries/user_agent.html
                    
12 */
                    
348		{
                    
349			$languages = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']));			
                    
350			$this->languages = explode(',', $languages);
                    
370		{
                    
371			$charsets = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_CHARSET']));
                    
372			
                    
                
Router.php https://bitbucket.org/jnewing/egs.git | PHP | 298 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2
                    
49
                    
50		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes.php'))
                    
51		{
                    
51		{
                    
52			include(APPPATH.'config/'.ENVIRONMENT.'/routes.php');
                    
53		}
                    
53		}
                    
54		elseif (is_file(APPPATH.'config/routes.php'))
                    
55		{
                    
55		{
                    
56			include(APPPATH.'config/routes.php');
                    
57		}
                    
141
                    
142		if (file_exists(APPPATH.'controllers/'.$segments[0].'.php'))
                    
143		{
                    
                
inflector_helper.php https://bitbucket.org/jdhall75/skillsdemo.git | PHP | 235 lines
                    
1<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 5.1.6 or newer
                    
6 *
                    
95			{
                    
96				$result = preg_replace($rule, $replacement, $result);
                    
97				break;
                    
152			{
                    
153				$result = preg_replace($rule, $replacement, $result);
                    
154				break;
                    
175	{
                    
176		return substr(str_replace(' ', '', ucwords(preg_replace('/[\s_]+/', ' ', $str))), 1);
                    
177	}
                    
193	{
                    
194		return preg_replace('/[\s]+/', '_', strtolower(trim($str)));
                    
195	}
                    
                
Signature.php https://github.com/miamiruby/cakestuff.git | PHP | 179 lines
                    
1<?php
                    
2
                    
72            $name = substr($className, strrpos($className, '_')+1);
                    
73            $name = preg_replace('#(Tool|Provider|Manifest)$#', '', $name);
                    
74            $this->_name = $name;
                    
                
ezfunctionhandler.php https://bitbucket.org/crevillo/enetcall.git | PHP | 150 lines
                    
1<?php
                    
2/**
                    
11/*!
                    
12  \class eZFunctionHandler ezfunctionhandler.php
                    
13  \brief The class eZFunctionHandler does
                    
69                $constantParameterArray = $aliasSettings->variable( $aliasFunctionName, 'Constant' );
                    
70                // prevent PHP warning in the loop below
                    
71                if ( !is_array( $constantParameterArray ) )
                    
94                        /*
                    
95                         Unfortunately, my PHP 4.3.6 doesn't work correctly
                    
96                         if flag PREG_SPLIT_NO_EMPTY is set.
                    
110                            // Remove backslashes used for delimiter escaping.
                    
111                            $constantParameter = preg_replace( '/\x5c{1};/', ';', $constantParameter );
                    
112                            $constantParameter = str_replace( '\\\\', '\\', $constantParameter );
                    
                
Twitter.php https://github.com/dingram/phergie.git | PHP | 212 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP version 5
                    
6 *
                    
27 */
                    
28require dirname(__FILE__) . '/Twitter/twitter.class.php';
                    
29require dirname(__FILE__) . '/Twitter/laconica.class.php';
                    
139	        if (stripos($tweeter, 'status') !== false) {
                    
140                $tweeter = preg_replace('/[^\d]+([\d]+$)/i', '\1', $tweeter);
                    
141                $tweet = $this->twitter->getTweetByNum($tweeter);
                    
170        $out =  '<@' . $tweet->user->screen_name .'> '
                    
171            . preg_replace('/\s+/', ' ', $tweet->text)
                    
172            . ' - ' . $ts . ' ago';
                    
                
Ce_cache_driver.php https://gitlab.com/sops21/mt-rubidoux.git | PHP | 262 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2
                    
181	{
                    
182		return preg_replace( '#(?<!:)//+#', '/', $str );
                    
183	}
                    
211	 *
                    
212	 * A method derived from a function originally posted by xelozz -at- gmail.com 18-Feb-2010 10:34 to http://us2.php.net/manual/en/function.memory-get-usage.php#96280
                    
213	 * Original code licensed under: http://creativecommons.org/licenses/by/3.0/legalcode
                    
                
ReflectionClassResource.php https://bitbucket.org/javiausias/m12-lluccio.git | PHP | 200 lines
                    
1<?php
                    
2
                    
143                // workaround HHVM bug with variadics, see https://github.com/facebook/hhvm/issues/5762
                    
144                yield preg_replace('/^  @@.*/m', '', new ReflectionMethodHhvmWrapper($m->class, $m->name));
                    
145            }
                    
147            foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
                    
148                yield preg_replace('/^  @@.*/m', '', $m);
                    
149
                    
                
utf8_functions.php https://gitlab.com/truongdacngoc1993/tuanviet.git | PHP | 303 lines
                    
1<?php
                    
2
                    
203
                    
204	$charlist = preg_replace( '!([\\\\\\-\\]\\[/^])!', '\\\${1}', $charlist );
                    
205
                    
205
                    
206	return preg_replace( '/^[' . $charlist . ']+/u', '', $str );
                    
207}
                    
219
                    
220	$charlist = preg_replace( '!([\\\\\\-\\]\\[/^])!', '\\\${1}', $charlist );
                    
221
                    
221
                    
222	return preg_replace( '/[' . $charlist . ']+$/u', '', $str );
                    
223}
                    
246{
                    
247	if( file_exists( NV_ROOTDIR . '/includes/utf8/lookup_' . NV_LANG_DATA . '.php' ) )
                    
248	{
                    
                
Documentation.php https://gitlab.com/Tiger66639/xinc.git | PHP | 168 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP version 5
                    
6 *
                    
10 * @copyright 2007 Arno Schneider, Barcelona
                    
11 * @license   http://www.gnu.org/copyleft/lgpl.html GNU/LGPL, see license.php
                    
12 *            This file is part of Xinc.
                    
28
                    
29require_once 'Xinc/Plugin/Abstract.php';
                    
30require_once 'Xinc/Plugin/Repos/Publisher/Documentation/Task.php';
                    
30require_once 'Xinc/Plugin/Repos/Publisher/Documentation/Task.php';
                    
31require_once 'Xinc/Plugin/Repos/Gui/Documentation/Widget.php';
                    
32
                    
84
                    
85        $sourceFile = preg_replace('/\/+/', '/', $sourceFile);
                    
86        $index = preg_replace('/\/+/', '/', $index);
                    
                
ExtractStyleBlocks.php git://github.com/ushahidi/Ushahidi_Web.git | PHP | 289 lines
                    
1<?php
                    
2
                    
2
                    
3// why is this a top level function? Because PHP 5.2.0 doesn't seem to
                    
4// understand how to interpret this filter if it's a static method.
                    
14 * @note
                    
15 *      See tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php for
                    
16 *      sample usage.
                    
43     * Save the contents of CSS blocks to style matches
                    
44     * @param $matches preg_replace style $matches array
                    
45     */
                    
56        if ($tidy !== null) $this->_tidy = $tidy;
                    
57        $html = preg_replace_callback('#<style(?:\s.*)?>(.+)</style>#isU', array($this, 'styleCallback'), $html);
                    
58        $style_blocks = $this->_styleMatches;
                    
                
Relationship.php https://github.com/preinheimer/Betting-Example.git | PHP | 162 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * Lithium: the most rad php framework
                    
4 *
                    
5 * @copyright     Copyright 2012, Union of RAD (http://union-of-rad.org)
                    
6 * @license       http://opensource.org/licenses/bsd-license.php The BSD License
                    
7 */
                    
117		if (!$config['to']) {
                    
118			$assoc = preg_replace("/\\w+$/", "", $config['from']) . $name;
                    
119			$config['to'] = Libraries::locate('models', $assoc);
                    
                
filelist.php http://rtoss.googlecode.com/svn/ | PHP | 500 lines
                    
166
                    
167$myname=preg_replace('/.*\/+/', '', $_SERVER['PHP_SELF']);
                    
168$mypath=preg_replace("/$myname$/", '', $_SERVER['PHP_SELF']);
                    
362
                    
363	$baseurl = $usepathinfo?$_SERVER['PHP_SELF'] . '/'.$cdir . '?':$_SERVER['PHP_SELF'] . '?dir='.$cdir . '&';
                    
364	$fileurl = 'sort=name&amp;order=asc';
                    
403	?>
                    
404	<div><a href="<?=$usepathinfo?$_SERVER['PHP_SELF'].'/'.urlencode($leadon.$dirs[$i]):$_SERVER['PHP_SELF'] . '?dir='.urlencode($leadon.$dirs[$i]);?>" class="<?=$class;?>"><img src="<?=$myfilespath;?>/folder.png" alt="<?=$dirs[$i];?>" /><strong><?=$dirs[$i];?></strong> <em>-</em> <?=date ("M d Y h:i:s A", filemtime($leadon.$dirs[$i]));?></a></div>
                    
405	<?
                    
436	?>
                    
437	<div><?php if($showdelete) { ?><a class="<?=$class;?>" style="float:left;text-align:left;width:0.5em;padding:2px;clear:none;" href="<?=$_SERVER['PHP_SELF'];?>?file=<?=urlencode($leadon.$files[$i]);?>&amp;action=del">D</a><?php } ?><a href="<?=$fileurl;?>" class="<?=$class;?>"<?=$thumb2;?>><img src="<?=$myfilespath;?>/<?=$icon;?>" alt="<?=$files[$i];?>" /><strong><?=$filename;?></strong> <em><?=properSize(filesize($leadon.$files[$i]),2);?></em> <?=date ("M d Y h:i:s A", filemtime($leadon.$files[$i]));?><?=$thumb;?></a></div>
                    
438	<?
                    
447		$phpmaxsize = trim($phpmaxsize);
                    
448		$last = strtolower($phpmaxsize{strlen($phpmaxsize)-1});
                    
449		switch($last) {
                    
                
RepositoryController.php https://bitbucket.org/felagund18/bugitor | PHP | 173 lines
                    
1<?php
                    
2/*
                    
33?>
                    
34<?php
                    
35
                    
39     * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
                    
40     * using two-column layout. See 'protected/views/layouts/column2.php'.
                    
41     */
                    
69            $model->attributes=$_POST['Repository'];
                    
70                        $model->identifier = preg_replace( '/\s*/m', '', strtolower($model->name));
                    
71                        $directory = Yii::app()->file->set('repositories', true);
                    
75                        } else {
                    
76                            if (PHP_OS === 'WINNT') {
                    
77                                $commandString = 'start /b rmdir /S /Q "'.$model->local_path.'"';
                    
130                        {
                    
131                            if (PHP_OS === 'WINNT') {
                    
132                                $commandString = 'start /b rmdir /S /Q "'.$model->local_path.'"';
                    
                
sessions.php https://github.com/happyxlq/zencart_svn.git | PHP | 213 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * functions/sessions.php
                    
4 * Session functions
                    
9 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
                    
10 * @version $Id: sessions.php 16745 2010-06-17 12:02:17Z wilt $
                    
11 */
                    
53      if (!is_object($db)) {
                    
54        //PHP 5.2.0 bug workaround ...
                    
55        $db = new queryFactory();
                    
109    }
                    
110  	if (preg_replace('/[a-zA-Z0-9]/', '', session_id()) != '') 
                    
111  	{
                    
137      $tempSessid = $sessid;
                    
138  	  if (preg_replace('/[a-zA-Z0-9]/', '', $tempSessid) != '') 
                    
139  	  {
                    
                
search.php https://github.com/bolis97/joomla-cms.git | PHP | 239 lines
                    
1<?php
                    
2/**
                    
61		// Deprecated in 1.6 use $lang->getIgnoredSearchWords instead
                    
62		$ignoreFile		= $lang->getLanguagePath() . '/' . $tag . '/' . $tag.'.ignore.php';
                    
63		if (file_exists($ignoreFile)) {
                    
156		// strips tags won't remove the actual jscript
                    
157		$text = preg_replace("'<script[^>]*>.*?</script>'si", "", $text);
                    
158		$text = preg_replace('/{.+?}/', '', $text);
                    
158		$text = preg_replace('/{.+?}/', '', $text);
                    
159		//$text = preg_replace('/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is','\2', $text);
                    
160		// replace line breaking tags with whitespace
                    
160		// replace line breaking tags with whitespace
                    
161		$text = preg_replace("'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text);
                    
162
                    
187			foreach($searchRegex as $regex) {
                    
188				$text = preg_replace($regex, '', $text);
                    
189			}
                    
                
main.php https://github.com/Yhonay/shimmie2.git | PHP | 156 lines
                    
1<?php
                    
2/**
                    
33		) as $el) {
                    
34			$text = preg_replace("!\[$el\](.*?)\[/$el\]!s", "<$el>$1</$el>", $text);
                    
35		}
                    
35		}
                    
36		$text = preg_replace('!&gt;&gt;([^\d].+)!s', '<blockquote><small>$1</small></blockquote>', $text);
                    
37		$text = preg_replace('!&gt;&gt;(\d+)(#c?\d+)?!s', '<a class="shm-clink" data-clink-sel="$2" href="'.make_link('post/view/$1$2').'">&gt;&gt;$1$2</a>', $text);
                    
37		$text = preg_replace('!&gt;&gt;(\d+)(#c?\d+)?!s', '<a class="shm-clink" data-clink-sel="$2" href="'.make_link('post/view/$1$2').'">&gt;&gt;$1$2</a>', $text);
                    
38		$text = preg_replace('!\[url=site://(.*?)(#c\d+)?\](.*?)\[/url\]!s', '<a class="shm-clink" data-clink-sel="$2" href="'.make_link('$1$2').'">$3</a>', $text);
                    
39		$text = preg_replace('!\[url\]site://(.*?)(#c\d+)?\[/url\]!s', '<a class="shm-clink" data-clink-sel="$2" href="'.make_link('$1$2').'">$1$2</a>', $text);
                    
39		$text = preg_replace('!\[url\]site://(.*?)(#c\d+)?\[/url\]!s', '<a class="shm-clink" data-clink-sel="$2" href="'.make_link('$1$2').'">$1$2</a>', $text);
                    
40		$text = preg_replace('!\[url=((?:https?|ftp|irc|mailto)://.*?)\](.*?)\[/url\]!s', '<a href="$1">$2</a>', $text);
                    
41		$text = preg_replace('!\[url\]((?:https?|ftp|irc|mailto)://.*?)\[/url\]!s', '<a href="$1">$1</a>', $text);
                    
41		$text = preg_replace('!\[url\]((?:https?|ftp|irc|mailto)://.*?)\[/url\]!s', '<a href="$1">$1</a>', $text);
                    
42		$text = preg_replace('!\[email\](.*?)\[/email\]!s', '<a href="mailto:$1">$1</a>', $text);
                    
43		$text = preg_replace('!\[img\](https?:\/\/.*?)\[/img\]!s', '<img src="$1">', $text);
                    
                
DefaultHelpers.php https://github.com/papousek/zimodej-utils.git | PHP | 283 lines
                    
1<?php
                    
2
                    
92		//   \x09 \x0A \x0D \x85 allowed directly, C0, C1 and \x7F allowed as character references
                    
93		return htmlSpecialChars(preg_replace('#[\x00-\x08\x0B\x0C\x0E-\x1F]+#', '', $s), ENT_QUOTES);
                    
94	}
                    
160			callback(create_function('$m', '
                    
161				return trim(preg_replace("#[ \\t\\r\\n]+#", " ", $m[0]));
                    
162			')));
                    
                
common.php https://github.com/chrishildebrandt/zafenio.git | PHP | 232 lines
                    
127{
                    
128	die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
                    
129}
                    
141
                    
142	$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
                    
143	if (!$script_name)
                    
196
                    
197require($phpbb_root_path . 'includes/functions.' . $phpEx);
                    
198require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
                    
214// Connect to DB
                    
215$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false);
                    
216
                    
224require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
                    
225$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
                    
226
                    
                
post.php http://core.svn.wordpress.org/ | PHP | 438 lines
                    
348<?php if ( isset($_GET['posted']) ) : ?>
                    
349<div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?> &raquo;</a></p></div>
                    
350<?php endif; ?>
                    
391?>
                    
392<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_settings('blogname'))); ?></a> 
                    
393<?php
                    
395?>
                    
396<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
                    
397<script type="text/javascript">
                    
410?>
                    
411<a href="javascript:location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/post.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
                    
412<?php
                    
414?>
                    
415<a href="javascript:Q='';location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
                    
416<?php
                    
                
PhpRenderer.php git://github.com/unirgy/buckyball.git | PHP | 235 lines
                    
18    {
                    
19        return preg_replace('~(^\?|<\?)~', "<?php echo '\\1'; ?>", $string);
                    
20    }
                    
53        if ($this->isEchoMode()) {
                    
54            $fmt = '<?php echo %s; ?>';
                    
55
                    
58                if ($node->getEscaping()->isOnce()) {
                    
59                    $fmt = "<?php echo htmlspecialchars(%s,ENT_QUOTES,'%s',false); ?>";
                    
60                } else {
                    
83            if (preg_match('~[:;]\s*$~', $content)) {
                    
84                $this->write(sprintf('<?php %s ?>' , $content));
                    
85            } else {
                    
88        } else {
                    
89            $this->write(sprintf('<?php %s { ?>' , $content));
                    
90        }
                    
                
omega_tools.drush.inc https://bitbucket.org/twinbit/ddayroma2011.git | Pascal | 142 lines
                    
1<?php
                    
2
                    
44    $exec = drush_omega_tools_subtheme($name, $type);
                    
45    // Avoid the php memory of the $output array in drush_shell_exec().
                    
46    if ($exec) {
                    
59  // replace non-alphanumeric characters with an underscore
                    
60	$name = strtolower(preg_replace('/\W/', '_', $name));
                    
61	//clean up leading/trailing and double underscores
                    
113      $exec = 'rsync -r ' . $omega_path .'/* '. $theme_dir .'/'. $name;
                    
114      // replace instances of omega_starterkit in all php files
                    
115      //$exec .= '; sed -i.bak s/omega_starterkit/'. $name .'/ '. $theme_dir .'/'. $name .'/template.php';
                    
115      //$exec .= '; sed -i.bak s/omega_starterkit/'. $name .'/ '. $theme_dir .'/'. $name .'/template.php';
                    
116      //$exec .= '; sed -i.bak s/omega_starterkit/'. $name .'/ '. $theme_dir .'/'. $name .'/theme-settings.php';
                    
117      // move the .info file
                    
127      $exec = 'rsync -r ' . $omega_path .'/* '. $theme_dir .'/'. $name;
                    
128      // replace instances of omega_starterkit in all php files
                    
129      //$exec .= '; sed -i.bak s/omega_starterkit_xhtml/'. $name .'/ '. $theme_dir .'/'. $name .'/template.php';
                    
                
users_controller.php git://github.com/croogo/croogo.git | PHP | 301 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP version 5
                    
6 *
                    
10 * @author   Fahad Ibnay Heylaal <contact@fahad19.com>
                    
11 * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
                    
12 * @link     http://www.croogo.org
                    
177                $this->Email->from = Configure::read('Site.title') . ' '
                    
178                    . '<croogo@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])).'>';
                    
179                $this->Email->to = $this->data['User']['email'];
                    
232            $this->Email->from = Configure::read('Site.title') . ' '
                    
233                    . '<croogo@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])).'>';
                    
234            $this->Email->to = $user['User']['email'];
                    
                
AdapterOptions.php https://bitbucket.org/aboozar/zf2.git | PHP | 282 lines
                    
1<?php
                    
2/**
                    
84        foreach ($this as $key => $value) {
                    
85            $normalizedKey = preg_replace_callback('/([A-Z])/', $transform, $key);
                    
86            $array[$normalizedKey] = $value;
                    
                
fx_layout.php http://comet.googlecode.com/svn/trunk/ | PHP | 313 lines
                    
1<?php
                    
2
                    
89                            $method = (string)$_xmlBlock['method'];
                    
90                            $param  = preg_replace_callback("/{{(.*)}}/",
                    
91                                create_function(
                    
101                            foreach ($_attributes as $key => $value) {
                    
102                                $value = preg_replace_callback("/{{(.*)}}/",
                    
103                                    create_function(
                    
202                    $method = (string)$_xmlBlock['method'];
                    
203                    $param  = preg_replace_callback("/{{(.*)}}/",
                    
204                        create_function(
                    
214                    foreach ($_attributes as $key => $value) {
                    
215                        $value = preg_replace_callback("/{{(.*)}}/",
                    
216                            create_function(
                    
                
elFinderVolumeS3.class.php git://github.com/QuickAppsCMS/QuickApps-CMS.git | PHP | 725 lines
                    
1<?php
                    
2
                    
63	
                    
64		$newpath =  preg_replace("/\/$/", "", $path);
                    
65		$dn = substr($path, 0, strrpos($newpath, '/')) ;
                    
107	protected function _normpath($path) {
                    
108		$tmp =  preg_replace("/^\//", "", $path);
                    
109		$tmp =  preg_replace("/\/\//", "/", $tmp);
                    
109		$tmp =  preg_replace("/\/\//", "/", $tmp);
                    
110		$tmp =  preg_replace("/\/$/", "", $tmp);
                    
111		return $tmp;
                    
130		
                    
131		$newpath =  preg_replace("/\/$/", "", $newpath);
                    
132	
                    
343		
                    
344		$s3path = preg_replace("/^\//", "", $path) . '/';
                    
345		
                    
                
users-edit.php git://github.com/q2a/question2answer.git | PHP | 542 lines
                    
1<?php
                    
2/*
                    
18
                    
19	More about this license: http://www.question2answer.org/license.php
                    
20*/
                    
50{
                    
51	require_once QA_INCLUDE_DIR . 'db/users.php';
                    
52	require_once QA_INCLUDE_DIR . 'util/string.php';
                    
57	$handle = qa_remove_utf8mb4($handle);
                    
58	$handle = preg_replace('/\p{C}+/u', '', $handle);
                    
59
                    
103{
                    
104	require_once QA_INCLUDE_DIR . 'util/string.php';
                    
105	require_once QA_INCLUDE_DIR . 'db/maxima.php';
                    
105	require_once QA_INCLUDE_DIR . 'db/maxima.php';
                    
106	require_once QA_INCLUDE_DIR . 'db/users.php';
                    
107
                    
                
modZapier.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 314 lines
                    
1<?php
                    
2/* Copyright (C) 2004-2018  Laurent Destailleur     <eldy@users.sourceforge.net>
                    
21 *
                    
22 *  \file       htdocs/core/modules/modZapier.class.php
                    
23 *  \ingroup    zapier
                    
25 */
                    
26include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
                    
27
                    
55		// Module label (no space allowed), used if translation string 'ModuleZapierName' not found (Zapier is name of module).
                    
56		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
57		// Module description, used if translation string 'ModuleZapierDesc' not found (Zapier is name of module).
                    
90			'css' => array(
                    
91				//    '/zapier/css/zapier.css.php',
                    
92			),
                    
94			'js' => array(
                    
95				//   '/zapier/js/zapier.js.php',
                    
96			),
                    
                
BaseLint.php git://github.com/robotis/PHPLinter.git | PHP | 538 lines
                    
1<?php
                    
2/**
                    
5----------------------------------------------------------------------+
                    
6*  @file 			BaseLint.php
                    
7*  @author 			Jóhann T. Maríusson <jtm@robot.is>
                    
8*  @since 		    Oct 29, 2011
                    
9*  @package 		PHPLinter
                    
10*  @copyright     
                    
10*  @copyright     
                    
11*    phplinter is free software: you can redistribute it and/or modify
                    
12*    it under the terms of the GNU General Public License as published by
                    
24*/
                    
25namespace phplinter\Lint;
                    
26use PHPLinter\Tokenizer;
                    
54		$dir = dirname(__FILE__);
                    
55		$this->globals 	= require $dir . '/../globals.php';
                    
56		$this->uvars	= require $dir . '/../uservars.php';
                    
                
modTicket.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 353 lines
                    
60		// (where XXX is value of numeric property 'numero' of module)
                    
61		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
62		// Module description
                    
79		// for specific path of parts (eg: /ticket/core/modules/barcode)
                    
80		// for specific css file (eg: /ticket/css/ticket.css.php)
                    
81		$this->module_parts = array(
                    
98		$this->conflictwith = array(); // List of module class names as string this module is in conflict with
                    
99		$this->phpmin = array(5, 6); // Minimum version of PHP required by module
                    
100		$this->langfiles = array("ticket");
                    
160			0=>array('file'=>'box_last_ticket.php', 'enabledbydefaulton'=>'Home'),
                    
161			1=>array('file'=>'box_last_modified_ticket.php', 'enabledbydefaulton'=>'Home'),
                    
162			2=>array('file'=>'box_ticket_by_severity.php', 'enabledbydefaulton'=>'ticketindex'),
                    
287			'mainmenu' => 'ticket',
                    
288			'url' => '/ticket/stats/index.php',
                    
289			'langs' => 'ticket',
                    
                
modTakePos.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 310 lines
                    
78		// for specific path of parts (eg: /takepos/core/modules/barcode)
                    
79		// for specific css file (eg: /takepos/css/takepos.css.php)
                    
80		$this->module_parts = array(
                    
95
                    
96		// Config pages. Put here list of php page, stored into takepos/admin directory, to use to setup module.
                    
97		$this->config_page_url = array("setup.php@takepos");
                    
104		$this->langfiles = array("cashdesk");
                    
105		$this->phpmin = array(5, 6); // Minimum version of PHP required by module
                    
106		$this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module
                    
130		// Example:
                    
131		// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@takepos:$user->rights->takepos->read:/takepos/mynewtab1.php?id=__ID__');  					// To add a new tab identified by code tabname1
                    
132		// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@takepos:$user->rights->othermodule->read:/takepos/mynewtab2.php?id=__ID__',  	// To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
                    
175		// Boxes/Widgets
                    
176		// Add here list of php file(s) stored in takepos/core/boxes that contains class to show a widget.
                    
177		$this->boxes = array(
                    
                
modMultiCurrency.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 317 lines
                    
75		// for specific path of parts (eg: /multicurrency/core/modules/barcode)
                    
76		// for specific css file (eg: /multicurrency/css/multicurrency.css.php)
                    
77		$this->module_parts = array();
                    
82
                    
83		// Config pages. Put here list of php page, stored into multicurrency/admin directory, to use to setup module.
                    
84		$this->config_page_url = array("multicurrency.php");
                    
90		$this->conflictwith = array(); // List of modules id this module is in conflict with
                    
91		$this->phpmin = array(5, 6); // Minimum version of PHP required by module
                    
92		$this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module
                    
102		// Array to add new pages in new tabs
                    
103		// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@multicurrency:$user->rights->multicurrency->read:/multicurrency/mynewtab1.php?id=__ID__',  					// To add a new tab identified by code tabname1
                    
104		//                              'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@multicurrency:$user->rights->othermodule->read:/multicurrency/mynewtab2.php?id=__ID__',  	// To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
                    
151		// Boxes
                    
152		// Add here list of php file(s) stored in core/boxes that contains class to show a box.
                    
153		$this->boxes = array(); // List of boxes
                    
                
modMrp.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 505 lines
                    
58		// Module label (no space allowed), used if translation string 'ModuleMrpName' not found (Mrp is name of module).
                    
59		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
60		// Module description, used if translation string 'ModuleMrpDesc' not found (Mrp is name of module).
                    
94			'css' => array(
                    
95				//    '/mrp/css/mrp.css.php',
                    
96			),
                    
124		$this->langfiles = array("mrp");
                    
125		$this->phpmin = array(5, 6); // Minimum version of PHP required by module
                    
126		$this->need_dolibarr_version = array(8, 0); // Minimum version of Dolibarr required by module
                    
157		// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mrp:$user->rights->mrp->read:/mrp/mynewtab1.php?id=__ID__');  					// To add a new tab identified by code tabname1
                    
158		// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mrp:$user->rights->othermodule->read:/mrp/mynewtab2.php?id=__ID__',  	// To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
                    
159		// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove');                                                     										// To remove an existing tab identified by code tabname
                    
249		$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
                    
250		$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
                    
251		$r++;
                    
                
modHoliday.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 345 lines
                    
60		// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
                    
61		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
62		// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
                    
89		$this->conflictwith = array(); // List of module class names as string this module is in conflict with
                    
90		$this->phpmin = array(5, 6); // Minimum version of PHP required by module
                    
91		$this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module
                    
144				'jobtype' => 'method',
                    
145				'class' => 'holiday/class/holiday.class.php',
                    
146				'objectname' => 'Holiday',
                    
167		$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
                    
168		$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
                    
169		$r++;
                    
173		$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
                    
174		$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
                    
175		$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
                    
                
modDav.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 300 lines
                    
59		// Module label (no space allowed), used if translation string 'ModuledavName' not found (MyModue is name of module).
                    
60		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
61		// Module description, used if translation string 'ModuledavDesc' not found (MyModue is name of module).
                    
77		// for specific path of parts (eg: /dav/core/modules/barcode)
                    
78		// for specific css file (eg: /dav/css/dav.css.php)
                    
79		$this->module_parts = array();
                    
93		$this->langfiles = array("admin");
                    
94		$this->phpmin = array(5, 6); // Minimum version of PHP required by module
                    
95		$this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module
                    
167			//0=>array('file'=>'davwidget1.php@dav','note'=>'Widget provided by dav','enabledbydefaulton'=>'Home'),
                    
168			//1=>array('file'=>'davwidget2.php@dav','note'=>'Widget provided by dav'),
                    
169			//2=>array('file'=>'davwidget3.php@dav','note'=>'Widget provided by dav')
                    
220								'leftmenu'=>'',
                    
221								'url'=>'/dav/davindex.php',
                    
222								'langs'=>'dav@dav',	        // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
                    
                
modDataPolicy.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 262 lines
                    
27 */
                    
28include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
                    
29
                    
65		// Module label (no space allowed), used if translation string 'ModuledatapolicyName' not found (MyModue is name of module).
                    
66		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
67		// Module description, used if translation string 'ModuledatapolicyDesc' not found (MyModue is name of module).
                    
83		// for specific path of parts (eg: /datapolicy/core/modules/barcode)
                    
84		// for specific css file (eg: /datapolicy/css/datapolicy.css.php)
                    
85		$this->module_parts = array(
                    
101		// Config pages. Put here list of php page, stored into datapolicy/admin directory, to use to setup module.
                    
102		$this->config_page_url = array("setup.php@datapolicy");
                    
103
                    
109		$this->langfiles = array("datapolicy@datapolicy");
                    
110		$this->phpmin = array(5, 3); // Minimum version of PHP required by module
                    
111		$this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module
                    
                
BlockCommentSniff.php git://github.com/jonswar/perl-code-tidyall.git | PHP | 388 lines
                    
12use PHP_CodeSniffer\Sniffs\Sniff;
                    
13use PHP_CodeSniffer\Files\File;
                    
14use PHP_CodeSniffer\Util\Tokens;
                    
44     *
                    
45     * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned.
                    
46     * @param int                         $stackPtr  The position of the current token in the
                    
53        if ($this->tabWidth === null) {
                    
54            if (isset($phpcsFile->config->tabWidth) === false || $phpcsFile->config->tabWidth === 0) {
                    
55                // We have no idea how wide tabs are, so assume 4 spaces for fixing.
                    
155
                    
156                $phpcsFile->fixer->endChangeset();
                    
157            }
                    
373                $error = 'Empty line required before block comment';
                    
374                $phpcsFile->addError($error, $stackPtr, 'NoEmptyLineBefore');
                    
375            }
                    
                
modBom.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 528 lines
                    
62		// Module label (no space allowed), used if translation string 'ModuleBomName' not found (Bom is name of module).
                    
63		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
64		// Module description, used if translation string 'ModuleBomDesc' not found (Bom is name of module).
                    
91			'models' => 0,                                   	// Set this to 1 if module has its own models directory (core/modules/xxx)
                    
92			'css' => array('/bom/css/bom.css.php'),	// Set this to relative path of css file if module has its own css file
                    
93			 'js' => array('/bom/js/bom.js.php'),          // Set this to relative path of js file if module must load a js on all pages
                    
111		$this->langfiles = array("mrp");
                    
112		//$this->phpmin = array(5, 6));					// Minimum version of PHP required by module
                    
113		$this->need_dolibarr_version = array(9, 0); // Minimum version of Dolibarr required by module
                    
145		// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@bom:$user->rights->bom->read:/bom/mynewtab1.php?id=__ID__');  					// To add a new tab identified by code tabname1
                    
146		// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@bom:$user->rights->othermodule->read:/bom/mynewtab2.php?id=__ID__',  	// To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
                    
147		// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove');                                                     										// To remove an existing tab identified by code tabname
                    
220		$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
                    
221		$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
                    
222
                    
                
website.lib.php git://github.com/Dolibarr/dolibarr.git | PHP | 1205 lines
                    
103 * @param	string		$content			Content to replace
                    
104 * @param	int			$removephppart		0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections.
                    
105 * @param	string		$contenttype		Content type
                    
173	// Replace relative link /xxx.php#aaa or /xxx.php with dolibarr URL (we discard param ?...)
                    
174	$content = preg_replace('/(href=")\/?([^:\"\!]*)\.php(#[^\"<>]*)?\"/', '\1!~!~!~'.DOL_URL_ROOT.'/website/index.php?website='.$website->ref.'&pageref=\2\3"', $content, -1, $nbrep);
                    
175	// Replace relative link /xxx.php?a=b&c=d#aaa or /xxx.php?a=b&c=d with dolibarr URL
                    
187	// <img src="viewimage.php/modulepart=medias&file=image.png" => <img src="dolibarr/viewimage.php/modulepart=medias&file=image.png"
                    
188	$content = preg_replace('/(<img[^>]*src=")(\/?viewimage\.php)/', '\1!~!~!~'.DOL_URL_ROOT.'/viewimage.php', $content, -1, $nbrep);
                    
189
                    
190	// action="newpage.php" => action="dolibarr/website/index.php?website=...&pageref=newpage
                    
191	$content = preg_replace('/(action=")\/?([^:\"]*)(\.php\")/', '\1!~!~!~'.DOL_URL_ROOT.'/website/index.php?website='.$website->ref.'&pageref=\2"', $content, -1, $nbrep);
                    
192
                    
261		// Replace relative link /xxx.php#aaa or /xxx.php with dolibarr URL:  ...href="....php" (we discard param ?...)
                    
262		$content = preg_replace('/(href=")\/?([^:\"\!]*)\.php(#[^\"<>]*)?\"/', '\1!~!~!~'.DOL_URL_ROOT.'/public/website/index.php?website='.$website->ref.'&pageref=\2\3"', $content, -1, $nbrep);
                    
263		// Replace relative link /xxx.php?a=b&c=d#aaa or /xxx.php?a=b&c=d with dolibarr URL
                    
                
Parsedown.php git://github.com/QuickAppsCMS/QuickApps-CMS.git | PHP | 1197 lines
                    
1<?php
                    
2
                    
293
                    
294                        $substring = preg_replace('/^[|][ ]*/', '', $line);
                    
295                        $substring = preg_replace('/[|]?[ ]*$/', '', $substring);
                    
384
                    
385                        $substring = preg_replace('/^[|][ ]*/', '', $block['content']);
                    
386                        $substring = preg_replace('/[|]?[ ]*$/', '', $substring);
                    
                
Base.php git://github.com/atk4/atk4.git | PHP | 581 lines
                    
1<?php
                    
2/**
                    
130            return ucwords(strtr(
                    
131                preg_replace('/_id$/', '', $this->short_name),
                    
132                '_',
                    
                
utils.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 1162 lines
                    
1<?php
                    
2/* Copyright (C) 2016	Laurent Destailleur <eldy@users.sourceforge.net>
                    
19/**
                    
20 *   	\file       htdocs/core/class/utils.class.php
                    
21 *      \ingroup    core
                    
63
                    
64		require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
                    
65
                    
111					$filelog = $conf->global->SYSLOG_FILE;
                    
112					$filelog = preg_replace('/DOL_DATA_ROOT/i', DOL_DATA_ROOT, $filelog);
                    
113
                    
154				if (!empty($conf->ecm->enabled) && $choice == 'allfiles') {
                    
155					require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
                    
156					$ecmdirstatic = new EcmDirectory($this->db);
                    
190	 *  @param  int         $keeplastnfiles    Keep only last n files (not used yet)
                    
191	 *  @param	int		    $execmethod		   0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method
                    
192	 *  @return	int						       0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
                    
                
Basic.php git://github.com/atk4/atk4.git | PHP | 1123 lines
                    
285    {
                    
286        // Changes PHP true to 1
                    
287        $a = strtolower($a);
                    
399     * Checks any PHP datetime format:
                    
400     * http://www.php.net/manual/en/datetime.formats.date.php.
                    
401     */
                    
411     * Checks any PHP datetime format:
                    
412     * http://www.php.net/manual/en/datetime.formats.date.php.
                    
413     */
                    
523
                    
524        return preg_replace($pattern, '', $a);
                    
525    }
                    
530    {
                    
531        return (int) $a = preg_replace('/[^0-9]/', '', $a);
                    
532    }
                    
                
VersionParser.php git://github.com/QuickAppsCMS/QuickApps-CMS.git | PHP | 579 lines
                    
1<?php
                    
2/**
                    
39    {
                    
40        $version = preg_replace('{#.+$}i', '', $version);
                    
41
                    
139        // match date-based versioning
                    
140            $version = preg_replace('{\D}', '-', $matches[1]);
                    
141            $index = 2;
                    
                
Mustache.php git://github.com/remiprev/pubwich.git | PHP | 641 lines
                    
1<?php
                    
2
                    
3/**
                    
4 * A Mustache implementation in PHP.
                    
5 *
                    
136	public function __toString() {
                    
137		// PHP doesn't like exceptions in __toString.
                    
138		// catch any exceptions and convert them to strings.
                    
232		$regex = '/' . $otag . '%\\s*([\\w_-]+)((?: [\\w]+=[\\w]+)*)\\s*' . $ctag . '\\n?/';
                    
233		return preg_replace_callback($regex, array($this, '_renderPragma'), $template);
                    
234	}
                    
236	/**
                    
237	 * A preg_replace helper to remove {{%PRAGMA}} tags and enable requested pragma.
                    
238	 *
                    
                
Web.php git://github.com/atk4/atk4.git | PHP | 655 lines
                    
1<?php
                    
2/**
                    
70    {
                    
71        $this->start_time = time() + preg_replace('/ .*/', '', microtime());
                    
72
                    
119        if (get_class($this) == 'App_Web') {
                    
120            $this->setConfig(array('url_postfix' => '.php', 'url_prefix' => ''));
                    
121        }
                    
                
functions.php git://github.com/QuickAppsCMS/QuickApps-CMS.git | PHP | 752 lines
                    
1<?php
                    
2/**
                    
31     *
                    
32     * Information is stored in `TMP/snapshot.php` file, it contains
                    
33     * useful information such as enabled languages, content types slugs, installed
                    
37     *
                    
38     * ```php
                    
39     * Configure::read('QuickApps.<option>');
                    
43     *
                    
44     * ```php
                    
45     * quickapps('<option>');
                    
159        foreach ($folder->read(false, false, true)[1] as $classFile) {
                    
160            $className = basename(preg_replace('/\.php$/', '', $classFile));
                    
161            if (!in_array($className, ['AppAspect', 'Aspect'])) {
                    
207                    foreach ($Folder->read(false, false, true)[1] as $classFile) {
                    
208                        $className = basename(preg_replace('/\.php$/', '', $classFile));
                    
209                        $subspace = $subspaces[$path];
                    
                
ez_sql_oracleTNS.php git://github.com/jv2222/ezSQL.git | PHP | 472 lines
                    
1<?php
                    
2
                    
59     * Use oci_pconnect instead of oci_connect to have connection pooling
                    
60     * enabled with PHP
                    
61     * @var boolean
                    
87     *                         Default is false
                    
88     * @throws Exception Requires Orcle OCI Lib and ez_sql_core.php
                    
89     */
                    
91        if ( ! function_exists ('OCILogon') ) {
                    
92            throw new Exception('<b>Fatal Error:</b> ezSQL_oracleTNS requires Oracle OCI Lib to be compiled and/or linked in to the PHP engine');
                    
93        }
                    
94        if ( ! class_exists ('ezSQLcore') ) {
                    
95            throw new Exception('<b>Fatal Error:</b> ezSQL_oracle8_9 requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used');
                    
96        }
                    
197                if ( ! $this->dbh = @oci_connect($dbuser, $dbpassword, $this->_tns, $this->_characterSet) ) {
                    
198                    $this->register_error($php_errormsg);
                    
199                    $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null;
                    
                
Parsedown.php git://github.com/ryancramerdesign/ProcessWire.git | PHP | 1528 lines
                    
1<?php
                    
2
                    
564        {
                    
565            $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
                    
566
                    
575
                    
576            $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
                    
577
                    
                
DbiDummy.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 3128 lines
                    
1<?php
                    
2/**
                    
11
                    
12namespace PhpMyAdmin\Tests\Stubs;
                    
13
                    
13
                    
14use PhpMyAdmin\Dbal\DatabaseName;
                    
15use PhpMyAdmin\Dbal\DbiExtension;
                    
15use PhpMyAdmin\Dbal\DbiExtension;
                    
16use PhpMyAdmin\FieldMetadata;
                    
17
                    
25use function json_encode;
                    
26use function preg_replace;
                    
27use function str_replace;
                    
36use const MYSQLI_TYPE_STRING;
                    
37use const PHP_EOL;
                    
38use const STDERR;
                    
                
api_bankaccounts.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 568 lines
                    
1<?php
                    
2/*
                    
20
                    
21require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
                    
22
                    
87			$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
                    
88			$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
                    
89		}
                    
200
                    
201		require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
                    
202
                    
276
                    
277		$url = DOL_URL_ROOT.'/compta/bank/line.php?rowid=';
                    
278		$label = '(banktransfert)';
                    
393
                    
394	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
                    
395	/**
                    
                
api_setup.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 2067 lines
                    
1<?php
                    
2/* Copyright (C) 2016   Xebax Christy           <xebax@wanadoo.fr>
                    
25
                    
26require_once DOL_DOCUMENT_ROOT.'/main.inc.php';
                    
27require_once DOL_DOCUMENT_ROOT.'/core/class/cstate.class.php';
                    
27require_once DOL_DOCUMENT_ROOT.'/core/class/cstate.class.php';
                    
28require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
                    
29
                    
82			$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
                    
83			$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
                    
84		}
                    
145			$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
                    
146			$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
                    
147		}
                    
209			  $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
                    
210			$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
                    
211		}
                    
                
BlockCommentSniff.php git://github.com/squizlabs/PHP_CodeSniffer.git | PHP | 399 lines
                    
13use PHP_CodeSniffer\Sniffs\Sniff;
                    
14use PHP_CodeSniffer\Util\Tokens;
                    
15
                    
44     *
                    
45     * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned.
                    
46     * @param int                         $stackPtr  The position of the current token in the
                    
53        if ($this->tabWidth === null) {
                    
54            if (isset($phpcsFile->config->tabWidth) === false || $phpcsFile->config->tabWidth === 0) {
                    
55                // We have no idea how wide tabs are, so assume 4 spaces for fixing.
                    
159                $phpcsFile->fixer->beginChangeset();
                    
160                $phpcsFile->fixer->replaceToken($stackPtr, '');
                    
161                $lastToken = array_pop($commentLines);
                    
162                for ($i = ($stackPtr + 1); $i <= $lastToken; $i++) {
                    
163                    $phpcsFile->fixer->replaceToken($i, '');
                    
164                }
                    
                
defaultvalues.php git://github.com/Dolibarr/dolibarr.git | PHP | 413 lines
                    
28
                    
29require '../main.inc.php';
                    
30require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
                    
30require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
                    
31require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
                    
32require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
                    
213	// Button on, click to disable
                    
214	$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&token='.newToken().'&value=0'.$param.'">';
                    
215	$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
                    
275if ($mode == 'createform') {
                    
276	$texthelp .= $langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php', 'societe/card.php?abc=val1&def=val2');
                    
277} else {
                    
277} else {
                    
278	$texthelp .= $langs->trans("PageUrlForDefaultValuesList", 'societe/list.php', 'societe/list.php?abc=val1&def=val2');
                    
279}
                    
                
phpthumb.functions.php git://github.com/thibaud-rohmer/PhotoShow.git | PHP | 1047 lines
                    
7///                                                         //
                    
8// phpthumb.functions.php - general support functions       //
                    
9//                                                         ///
                    
132			ob_end_clean();
                    
133			$phpinfo_array = explode("\n", $phpinfo);
                    
134		}
                    
134		}
                    
135		return $phpinfo_array;
                    
136	}
                    
149			);
                    
150			$phpinfo_array = phpthumb_functions::phpinfo_array();
                    
151			foreach ($phpinfo_array as $line) {
                    
224	static function ImageColorAllocateAlphaSafe(&$gdimg_hexcolorallocate, $R, $G, $B, $alpha=false) {
                    
225		if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.2', '>=') && ($alpha !== false)) {
                    
226			return ImageColorAllocateAlpha($gdimg_hexcolorallocate, $R, $G, $B, intval($alpha));
                    
                
phpThumb.php git://github.com/thibaud-rohmer/PhotoShow.git | PHP | 642 lines
                    
60
                    
61		$phpThumb->DebugMessage('Would have used cached (image/'.$phpThumb->thumbnailFormat.') file "'.$phpThumb->cache_filename.'" (Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT), but skipping because $_SERVER[HTTP_REFERER] ('.@$_SERVER['HTTP_REFERER'].') is not in $phpThumb->config_nooffsitelink_valid_domains ('.implode(';', $phpThumb->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__);
                    
62
                    
135		$phpThumb->config_disable_debug = false; // otherwise error message won't print
                    
136		$phpThumb->ErrorImage('failed to include_once('.dirname(__FILE__).'/phpThumb.config.php) - realpath="'.realpath(dirname(__FILE__).'/phpThumb.config.php').'"');
                    
137	}
                    
140	$phpThumb->config_disable_debug = false; // otherwise error message won't print
                    
141	$phpThumb->ErrorImage('Please rename "phpThumb.config.php.default" to "phpThumb.config.php"');
                    
142} else {
                    
143	$phpThumb->config_disable_debug = false; // otherwise error message won't print
                    
144	$phpThumb->ErrorImage('failed to include_once('.dirname(__FILE__).'/phpThumb.config.php) - realpath="'.realpath(dirname(__FILE__).'/phpThumb.config.php').'"');
                    
145}
                    
319
                    
320$PHPTHUMB_DEFAULTS_DISABLEGETPARAMS = (bool) ($phpThumb->config_cache_default_only_suffix && (strpos($phpThumb->config_cache_default_only_suffix, '*') !== false));
                    
321
                    
                
ColumnsDefinition.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 543 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin\Table;
                    
6
                    
6
                    
7use PhpMyAdmin\Charsets;
                    
8use PhpMyAdmin\Charsets\Charset;
                    
8use PhpMyAdmin\Charsets\Charset;
                    
9use PhpMyAdmin\Charsets\Collation;
                    
10use PhpMyAdmin\DatabaseInterface;
                    
10use PhpMyAdmin\DatabaseInterface;
                    
11use PhpMyAdmin\Partitioning\Partition;
                    
12use PhpMyAdmin\Partitioning\TablePartitionDefinition;
                    
12use PhpMyAdmin\Partitioning\TablePartitionDefinition;
                    
13use PhpMyAdmin\Query\Compatibility;
                    
14use PhpMyAdmin\Relation;
                    
                
Monitor.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 555 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin\Server\Status;
                    
9
                    
9
                    
10use PhpMyAdmin\DatabaseInterface;
                    
11use PhpMyAdmin\Profiling;
                    
11use PhpMyAdmin\Profiling;
                    
12use PhpMyAdmin\Server\SysInfo\SysInfo;
                    
13use PhpMyAdmin\Util;
                    
25use function preg_match;
                    
26use function preg_replace;
                    
27use function strlen;
                    
387            switch ($type) {
                    
388            /** @noinspection PhpMissingBreakStatementInspection */
                    
389                case 'insert':
                    
                
Privileges.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 3898 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin\Server;
                    
9
                    
10use mysqli_stmt;
                    
11use PhpMyAdmin\DatabaseInterface;
                    
12use PhpMyAdmin\Html\Generator;
                    
12use PhpMyAdmin\Html\Generator;
                    
13use PhpMyAdmin\Html\MySQLDocumentation;
                    
14use PhpMyAdmin\Message;
                    
14use PhpMyAdmin\Message;
                    
15use PhpMyAdmin\Query\Compatibility;
                    
16use PhpMyAdmin\Relation;
                    
16use PhpMyAdmin\Relation;
                    
17use PhpMyAdmin\RelationCleanup;
                    
18use PhpMyAdmin\ResponseRenderer;
                    
                
ImportCsv.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 890 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * CSV import plugin for phpMyAdmin
                    
4 *
                    
9
                    
10namespace PhpMyAdmin\Plugins\Import;
                    
11
                    
11
                    
12use PhpMyAdmin\File;
                    
13use PhpMyAdmin\Html\Generator;
                    
13use PhpMyAdmin\Html\Generator;
                    
14use PhpMyAdmin\Message;
                    
15use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
                    
15use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
                    
16use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
                    
17use PhpMyAdmin\Properties\Options\Items\NumberPropertyItem;
                    
                
ExportSql.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 2859 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin\Plugins\Export;
                    
9
                    
9
                    
10use PhpMyAdmin\Charsets;
                    
11use PhpMyAdmin\DatabaseInterface;
                    
11use PhpMyAdmin\DatabaseInterface;
                    
12use PhpMyAdmin\FieldMetadata;
                    
13use PhpMyAdmin\Plugins\ExportPlugin;
                    
13use PhpMyAdmin\Plugins\ExportPlugin;
                    
14use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
                    
15use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
                    
15use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
                    
16use PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup;
                    
17use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
                    
                
Generator.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 1354 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin\Html;
                    
9
                    
9
                    
10use PhpMyAdmin\Core;
                    
11use PhpMyAdmin\Message;
                    
11use PhpMyAdmin\Message;
                    
12use PhpMyAdmin\Profiling;
                    
13use PhpMyAdmin\Providers\ServerVariables\ServerVariablesProvider;
                    
13use PhpMyAdmin\Providers\ServerVariables\ServerVariablesProvider;
                    
14use PhpMyAdmin\Query\Compatibility;
                    
15use PhpMyAdmin\ResponseRenderer;
                    
15use PhpMyAdmin\ResponseRenderer;
                    
16use PhpMyAdmin\Sanitize;
                    
17use PhpMyAdmin\SqlParser\Lexer;
                    
                
Results.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 4765 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin\Display;
                    
6
                    
6
                    
7use PhpMyAdmin\Config\SpecialSchemaLinks;
                    
8use PhpMyAdmin\Core;
                    
8use PhpMyAdmin\Core;
                    
9use PhpMyAdmin\DatabaseInterface;
                    
10use PhpMyAdmin\FieldMetadata;
                    
10use PhpMyAdmin\FieldMetadata;
                    
11use PhpMyAdmin\Html\Generator;
                    
12use PhpMyAdmin\Index;
                    
12use PhpMyAdmin\Index;
                    
13use PhpMyAdmin\Message;
                    
14use PhpMyAdmin\Plugins\Transformations\Output\Text_Octetstream_Sql;
                    
                
ZoomSearchController.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 475 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin\Controllers\Table;
                    
6
                    
6
                    
7use PhpMyAdmin\Core;
                    
8use PhpMyAdmin\DatabaseInterface;
                    
8use PhpMyAdmin\DatabaseInterface;
                    
9use PhpMyAdmin\DbTableExists;
                    
10use PhpMyAdmin\Relation;
                    
10use PhpMyAdmin\Relation;
                    
11use PhpMyAdmin\ResponseRenderer;
                    
12use PhpMyAdmin\Table\Search;
                    
12use PhpMyAdmin\Table\Search;
                    
13use PhpMyAdmin\Template;
                    
14use PhpMyAdmin\Url;
                    
                
OperationsController.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 505 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin\Controllers\Table;
                    
6
                    
6
                    
7use PhpMyAdmin\Charsets;
                    
8use PhpMyAdmin\CheckUserPrivileges;
                    
8use PhpMyAdmin\CheckUserPrivileges;
                    
9use PhpMyAdmin\DatabaseInterface;
                    
10use PhpMyAdmin\DbTableExists;
                    
10use PhpMyAdmin\DbTableExists;
                    
11use PhpMyAdmin\Html\Generator;
                    
12use PhpMyAdmin\Index;
                    
12use PhpMyAdmin\Index;
                    
13use PhpMyAdmin\Message;
                    
14use PhpMyAdmin\Operations;
                    
                
ImportController.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 840 lines
                    
9use PhpMyAdmin\Core;
                    
10use PhpMyAdmin\DatabaseInterface;
                    
11use PhpMyAdmin\Encoding;
                    
11use PhpMyAdmin\Encoding;
                    
12use PhpMyAdmin\File;
                    
13use PhpMyAdmin\Html\Generator;
                    
16use PhpMyAdmin\ParseAnalyze;
                    
17use PhpMyAdmin\Plugins;
                    
18use PhpMyAdmin\Plugins\ImportPlugin;
                    
18use PhpMyAdmin\Plugins\ImportPlugin;
                    
19use PhpMyAdmin\ResponseRenderer;
                    
20use PhpMyAdmin\Sql;
                    
92        $local_import_file = $_POST['local_import_file'] ?? null;
                    
93        $show_as_php = $_POST['show_as_php'] ?? null;
                    
94
                    
                
Validator.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 613 lines
                    
10use PhpMyAdmin\Core;
                    
11use PhpMyAdmin\Util;
                    
12
                    
32use function preg_match;
                    
33use function preg_replace;
                    
34use function sprintf;
                    
52 *
                    
53 * Validation functions are assigned in $cfg_db['_validators'] (config.values.php).
                    
54 */
                    
350            $result['Servers/1/controluser'] = __(
                    
351                'Empty phpMyAdmin control user while using phpMyAdmin configuration storage!'
                    
352            );
                    
357            $result['Servers/1/controlpass'] = __(
                    
358                'Empty phpMyAdmin control user password while using phpMyAdmin configuration storage!'
                    
359            );
                    
                
Util.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 2753 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin;
                    
6
                    
6
                    
7use PhpMyAdmin\Html\Generator;
                    
8use PhpMyAdmin\Html\MySQLDocumentation;
                    
8use PhpMyAdmin\Html\MySQLDocumentation;
                    
9use PhpMyAdmin\Query\Utilities;
                    
10use PhpMyAdmin\SqlParser\Components\Expression;
                    
10use PhpMyAdmin\SqlParser\Components\Expression;
                    
11use PhpMyAdmin\SqlParser\Context;
                    
12use PhpMyAdmin\SqlParser\Token;
                    
12use PhpMyAdmin\SqlParser\Token;
                    
13use PhpMyAdmin\Utils\SessionCache;
                    
14use phpseclib3\Crypt\Random;
                    
                
Transformations.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 498 lines
                    
1<?php
                    
2/**
                    
17
                    
18namespace PhpMyAdmin;
                    
19
                    
19
                    
20use PhpMyAdmin\Plugins\TransformationsInterface;
                    
21
                    
31use function preg_match;
                    
32use function preg_replace;
                    
33use function readdir;
                    
155            foreach ($filestack as $file) {
                    
156                if (preg_match('|^[^.].*_.*_.*\.php$|', $file)) {
                    
157                    // File contains transformation functions.
                    
157                    // File contains transformation functions.
                    
158                    $parts = explode('_', str_replace('.php', '', $file));
                    
159                    $mimetype = $parts[0] . '/' . $parts[1];
                    
                
Tracking.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 1204 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin;
                    
9
                    
9
                    
10use PhpMyAdmin\Html\Generator;
                    
11
                    
24use function mb_strstr;
                    
25use function preg_replace;
                    
26use function rtrim;
                    
33/**
                    
34 * PhpMyAdmin\Tracking class
                    
35 */
                    
                
Tracker.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 958 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin;
                    
9
                    
9
                    
10use PhpMyAdmin\Plugins\Export\ExportSql;
                    
11use PhpMyAdmin\SqlParser\Parser;
                    
11use PhpMyAdmin\SqlParser\Parser;
                    
12use PhpMyAdmin\SqlParser\Statements\AlterStatement;
                    
13use PhpMyAdmin\SqlParser\Statements\CreateStatement;
                    
13use PhpMyAdmin\SqlParser\Statements\CreateStatement;
                    
14use PhpMyAdmin\SqlParser\Statements\DeleteStatement;
                    
15use PhpMyAdmin\SqlParser\Statements\DropStatement;
                    
15use PhpMyAdmin\SqlParser\Statements\DropStatement;
                    
16use PhpMyAdmin\SqlParser\Statements\InsertStatement;
                    
17use PhpMyAdmin\SqlParser\Statements\RenameStatement;
                    
                
Table.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 2713 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin;
                    
6
                    
6
                    
7use PhpMyAdmin\Html\Generator;
                    
8use PhpMyAdmin\Html\MySQLDocumentation;
                    
8use PhpMyAdmin\Html\MySQLDocumentation;
                    
9use PhpMyAdmin\Plugins\Export\ExportSql;
                    
10use PhpMyAdmin\Query\Compatibility;
                    
10use PhpMyAdmin\Query\Compatibility;
                    
11use PhpMyAdmin\Query\Generator as QueryGenerator;
                    
12use PhpMyAdmin\SqlParser\Components\Expression;
                    
12use PhpMyAdmin\SqlParser\Components\Expression;
                    
13use PhpMyAdmin\SqlParser\Components\OptionsArray;
                    
14use PhpMyAdmin\SqlParser\Context;
                    
                
Menu.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 602 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin;
                    
9
                    
9
                    
10use PhpMyAdmin\Query\Utilities;
                    
11use PhpMyAdmin\Utils\SessionCache;
                    
19use function mb_substr;
                    
20use function preg_replace;
                    
21use function strlen;
                    
205                if (mb_strstr($table['comment'], '; InnoDB free')) {
                    
206                    $table['comment'] = preg_replace('@; InnoDB free:.*?$@', '', $table['comment']);
                    
207                }
                    
                
InsertEdit.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 2582 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin;
                    
9
                    
9
                    
10use PhpMyAdmin\Html\Generator;
                    
11use PhpMyAdmin\Plugins\TransformationsPlugin;
                    
11use PhpMyAdmin\Plugins\TransformationsPlugin;
                    
12use PhpMyAdmin\Utils\Gis;
                    
13
                    
39use function preg_match;
                    
40use function preg_replace;
                    
41use function str_contains;
                    
53/**
                    
54 * PhpMyAdmin\InsertEdit class
                    
55 */
                    
                
Import.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 1794 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin;
                    
6
                    
6
                    
7use PhpMyAdmin\SqlParser\Parser;
                    
8use PhpMyAdmin\SqlParser\Statements\DeleteStatement;
                    
8use PhpMyAdmin\SqlParser\Statements\DeleteStatement;
                    
9use PhpMyAdmin\SqlParser\Statements\InsertStatement;
                    
10use PhpMyAdmin\SqlParser\Statements\ReplaceStatement;
                    
10use PhpMyAdmin\SqlParser\Statements\ReplaceStatement;
                    
11use PhpMyAdmin\SqlParser\Statements\UpdateStatement;
                    
12use PhpMyAdmin\SqlParser\Utils\Query;
                    
32use function preg_match;
                    
33use function preg_replace;
                    
34use function sprintf;
                    
                
Export.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 1342 lines
                    
1<?php
                    
2/**
                    
7
                    
8namespace PhpMyAdmin;
                    
9
                    
9
                    
10use PhpMyAdmin\Controllers\Database\ExportController as DatabaseExportController;
                    
11use PhpMyAdmin\Controllers\Server\ExportController as ServerExportController;
                    
11use PhpMyAdmin\Controllers\Server\ExportController as ServerExportController;
                    
12use PhpMyAdmin\Controllers\Table\ExportController as TableExportController;
                    
13use PhpMyAdmin\Plugins\ExportPlugin;
                    
13use PhpMyAdmin\Plugins\ExportPlugin;
                    
14use PhpMyAdmin\Plugins\SchemaPlugin;
                    
15
                    
42use function preg_match;
                    
43use function preg_replace;
                    
44use function strlen;
                    
                
CreateAddField.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 538 lines
                    
1<?php
                    
2
                    
4
                    
5namespace PhpMyAdmin;
                    
6
                    
6
                    
7use PhpMyAdmin\Html\Generator;
                    
8
                    
15use function min;
                    
16use function preg_replace;
                    
17use function strlen;
                    
77        for ($i = 0; $i < $fieldCount; ++$i) {
                    
78            // '0' is also empty for php :-(
                    
79            if (strlen($_POST['field_name'][$i]) === 0) {
                    
307
                    
308        return (string) preg_replace('@, $@', '', $sqlStatement);
                    
309    }
                    
                
Core.php git://github.com/phpmyadmin/phpmyadmin.git | PHP | 998 lines
                    
73        // change .. to .
                    
74        return (string) preg_replace('@\.\.*@', '.', $path);
                    
75    }
                    
77    /**
                    
78     * displays the given error message on phpMyAdmin error page in foreign language,
                    
79     * ends script execution and closes session
                    
160    {
                    
161        /* List of PHP documentation translations */
                    
162        $php_doc_languages = [
                    
203
                    
204        $doclink = self::getPHPDocLink('book.' . $extension . '.php');
                    
205        $message = sprintf($message, '[a@' . $doclink . '@Documentation][em]' . $extension . '[/em][/a]');
                    
372         * Avoid relative path redirect problems in case user entered URL
                    
373         * like /phpmyadmin/index.php/ which some web servers happily accept.
                    
374         */
                    
                
Couch.php git://github.com/dready92/PHP-on-Couch.git | PHP | 706 lines
                    
1<?PHP
                    
2
                    
19
                    
20namespace PHPOnCouch;
                    
21
                    
60	/**
                    
61	 * @var boolean tell if curl PHP extension has been detected
                    
62	 */
                    
77	{
                    
78		$this->dsn = preg_replace('@/+$@', '', $dsn);
                    
79		$this->options = $options;
                    
239	 *
                    
240	 * - the JSON object decoded as a PHP object
                    
241	 *
                    
245	 *
                    
246	 * @param callable $callable PHP function name / callable array ( see http://php.net/is_callable )
                    
247	 * @param string $method HTTP method to use (GET, POST, ...)
                    
                
Helper.php git://github.com/basdenooijer/solarium.git | PHP | 506 lines
                    
1<?php
                    
2/**
                    
106
                    
107        return preg_replace($pattern, '\\\$1', $input);
                    
108    }
                    
126    {
                    
127        return '"' . preg_replace('/("|\\\)/', '\\\$1', $input) . '"';
                    
128    }
                    
393
                    
394        return preg_replace_callback(
                    
395            $this->placeHolderPattern,
                    
                
TokensTest.php git://github.com/fabpot/PHP-CS-Fixer.git | PHP | 1438 lines
                    
1<?php
                    
2
                    
3/*
                    
4 * This file is part of PHP CS Fixer.
                    
5 *
                    
23 */
                    
24class TokensTest extends \PHPUnit_Framework_TestCase
                    
25{
                    
27    {
                    
28        $source = <<<'PHP'
                    
29<?php
                    
51}
                    
52PHP;
                    
53
                    
67    {
                    
68        $code = '<?php echo 1;';
                    
69        $tokens = Tokens::fromCode($code);
                    
                
LightOpenID.php git://github.com/hybridauth/hybridauth.git | PHP | 1256 lines
                    
1<?php
                    
2/*!
                    
2/*!
                    
3* This file is part of the LightOpenID PHP Library (https://github.com/iignatov/LightOpenID)
                    
4*
                    
26 *
                    
27 * It requires PHP >= 5.1.2 with cURL or HTTP/HTTPS stream wrappers enabled.
                    
28 *
                    
33 * @copyright   Copyright (c) 2013 Mewp
                    
34 * @license     http://opensource.org/licenses/mit-license.php  MIT License
                    
35 */
                    
101
                    
102        $uri = rtrim(preg_replace('#((?<=\?)|&)openid\.[^&]+#', '', $_SERVER['REQUEST_URI']), '?');
                    
103        $this->returnUrl = $this->trustRoot . $uri;
                    
220        } else {
                    
221            $server = @parse_url($url, PHP_URL_HOST);
                    
222        }
                    
                
filemanager.class.php git://github.com/sebtools/Neptune.git | PHP | 775 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 *	Filemanager PHP class
                    
4 *
                    
4 *
                    
5 *	filemanager.class.php
                    
6 *	class for the filemanager.php connector
                    
150			$path = $this->dynamic_fileroot. $this->get['path'];
                    
151			$path = preg_replace('~/+~', '/', $path); // remove multiple slashes
                    
152		} else {
                    
                
Format.php https://bitbucket.org/Yatindra_Mohite/witcircle_admin.git | PHP | 524 lines
                    
1<?php
                    
2
                    
34    /**
                    
35     * PHP output format
                    
36     */
                    
36     */
                    
37    const PHP_FORMAT = 'php';
                    
38
                    
208            // replace anything not alpha numeric
                    
209            $key = preg_replace('/[^a-z_\-0-9]/i', '', $key);
                    
210
                    
296    /**
                    
297     * @link http://www.metashock.de/2014/02/create-csv-file-in-memory-php/
                    
298     * @param mixed|NULL $data Optional data to pass, so as to override the data passed
                    
308        // Use a threshold of 1 MB (1024 * 1024)
                    
309        $handle = fopen('php://temp/maxmemory:1048576', 'w');
                    
310        if ($handle === FALSE)
                    
                
list.php http://jfxcms.googlecode.com/svn/ | PHP | 418 lines
                    
1<?php
                    
2###############   COPYLEFT GPLv3 LICENSE   ###############
                    
44            $moduleParams['m'] != strtolower($moduleParams['m']) ||
                    
45            preg_replace('/[^a-zA-Z0-9]/', '', $moduleParams['m']) != $moduleParams['m']){
                    
46            
                    
245                // lets install the module
                    
246                $safeModule = preg_replace('/[^a-zA-Z0-9]/', '', $module);
                    
247                $object = JFX::registry('JFX_Module_'.$safeModule);
                    
317while($file = readdir($dh)){
                    
318    if($file == '..' || $file == '.' || !is_dir($CONFIG->modulesDir.'/'.$file) || !file_exists($CONFIG->modulesDir.'/'.$file.'/'.$file.'.module.php')) continue;
                    
319
                    
324
                    
325    if(preg_replace('/[^a-zA-Z0-9]/', '', $file) != $file){
                    
326        JFX::addError($file.' is an invalid module name: must be alphanumeric');
                    
369    
                    
370    if($file == '..' || $file == '.' || !is_dir($CONFIG->themesDir.'/'.$file) || !file_exists($CONFIG->themesDir.'/'.$file.'/'.$file.'.theme.php')) continue;
                    
371
                    
                
files.php http://kfm.googlecode.com/svn/trunk/ | PHP | 329 lines
                    
1<?php
                    
2function _copyFiles($files,$dir_id){
                    
43			for($i=3;$i<count($arr)-2;++$i){
                    
44				$filename=preg_replace('/.* /','',$arr[$i]);
                    
45				if(!kfm_checkAddr($filename))return kfm_lang('errorZipContainsBannedFilename');
                    
49	}
                    
50	if($res){ # try PHP unzip command
                    
51		return kfm_lang('error: unzip failed');
                    
122			break;
                    
123		case 'php':
                    
124			$language = 'php';
                    
187	if(!$GLOBALS['kfm_allow_file_edit'])return 'error: '.kfm_lang('permissionDeniedEditFile');
                    
188	$prefix=preg_replace('/\*.*/','',$template);
                    
189	$postfix=preg_replace('/.*\*/','',$template);
                    
189	$postfix=preg_replace('/.*\*/','',$template);
                    
190	$precision=strlen(preg_replace('/[^*]/','',$template));
                    
191	for($i=1;$i<count($files)+1;++$i){
                    
                
class.smart.inc.php https://phpsysinfo.svn.sourceforge.net/svnroot/phpsysinfo | PHP | 281 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP version 5
                    
6 *
                    
6 *
                    
7 * @category  PHP
                    
8 * @package   PSI_Plugin_SMART
                    
9 * @author    Antoine Bertin <diaoulael@users.sourceforge.net>
                    
10 * @copyright 2009 phpSysInfo
                    
11 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License
                    
11 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License
                    
12 * @version   SVN: $Id: class.smart.inc.php 707 2012-11-28 10:20:49Z namiltd $
                    
13 * @link      http://phpsysinfo.sourceforge.net
                    
17 *
                    
18 * @category  PHP
                    
19 * @package   PSI_Plugin_SMART
                    
                
pm.php http://phpfor.googlecode.com/svn/trunk/ | PHP | 286 lines
                    
1<?php
                    
2
                    
6
                    
7    $Id: pm.php 12126 2008-01-11 09:40:32Z heyond $
                    
8*/
                    
164        if($_CACHE['badwords']['findpattern']) {
                    
165            $subject = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $subject);
                    
166            $message = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $message);
                    
274        $bbcodes = 'b|i|u|color|size|font|align|list|indent|url|email|code|img|float';
                    
275        $str = $this->base->cutstr(strip_tags(preg_replace(array(
                    
276                "/\[quote].*\[\/quote]/siU",
                    
                
CliOut.php git://github.com/Jaymon/Mingo.git | PHP | 252 lines
                    
1<?php
                    
2/** 
                    
73    
                    
74      echo sprintf('*************************** 1. row ***************************%s',PHP_EOL);
                    
75    
                    
93      
                    
94      echo PHP_EOL;
                    
95    
                    
129  
                    
130    $ret_str = sprintf('Array (%s)%s(%s',count($array),PHP_EOL,PHP_EOL);
                    
131
                    
139      
                    
140      }else if($val instanceof __PHP_Incomplete_Class){
                    
141      
                    
235  
                    
236    // first get the response in milliseconds (http://us2.php.net/manual/en/function.microtime.php#50962)
                    
237    $offset = 1000;
                    
                
gw_search.php http://glossword.googlecode.com/svn/trunk/ | PHP | 396 lines
                    
1<?php
                    
2/**
                    
43	/* Mask non-ASCII characters */
                    
44	$s = preg_replace( "/([\\xc0-\\xff][\\x80-\\xbf]*)/e", "'U8' . bin2hex( \"$1\" )", $s );
                    
45	
                    
71		/* Use values as key */
                    
72		/* PHP-bug: sometimes a string keys becomes interger */
                    
73		$ar_c_crc[$v] = sprintf( "%u", crc32( $v ) );
                    
98{
                    
99	return preg_replace( '/\b([a-z]+)/', '_\\1', $s );
                    
100}
                    
130
                    
131	#require_once( JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php' );
                    
132	
                    
159	
                    
160	require_once( $ar_cfg['path_core_abs'].'/gw_config.php' );
                    
161	
                    
                
LibraryAdapter.php https://bitbucket.org/saltwaterdev/offshorefinancial.com.git | PHP | 526 lines
                    
1<?php
                    
2/**
                    
153			$manifestPath = \JPath::clean($this->parent->getPath('manifest'));
                    
154			$element = preg_replace('/\.xml/', '', basename($manifestPath));
                    
155		}
                    
                
Ftp.php git://github.com/imagecms/ImageCMS.git | PHP | 660 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 5.1.6 or newer
                    
6 *
                    
73		// Prep the hostname
                    
74		$this->hostname = preg_replace('|.+?://|', '', $this->hostname);
                    
75	}
                    
420		// Add a trailing slash to the file path if needed
                    
421		$filepath = preg_replace("/(.+?)\/*$/", "\\1/",  $filepath);
                    
422
                    
601							'text',
                    
602							'php',
                    
603							'phps',
                    
603							'phps',
                    
604							'php4',
                    
605							'js',
                    
                
index.php http://bitcero-modules.googlecode.com/svn/ | PHP | 361 lines
                    
1<?php
                    
2// $Id: index.php 14 2009-09-09 18:22:07Z i.bitcero $
                    
10define('RMCLOCATION','dashboard');
                    
11require '../../include/cp_header.php';
                    
12include_once 'include/functions.php';
                    
12include_once 'include/functions.php';
                    
13include_once 'class/theme.php';
                    
14
                    
67		
                    
68		$cf = XOOPS_ROOT_PATH.'/themes/'.$t.'/config/theme.php';
                    
69		if (file_exists($cf)){
                    
77		
                    
78		$rtheme = preg_replace('/\s+/', '', strtolower($t));
                    
79		$rtheme = str_replace('-','',$rtheme);
                    
117	//RMTemplate::get()->add_style('themes.css', 'xthemes');
                    
118	include_once 'templates/xt_index.php';
                    
119	
                    
                
SP_Uri.php http://phpfor.googlecode.com/svn/trunk/ | PHP | 280 lines
                    
1<?php
                    
2
                    
18
                    
19        @include(APPBASE.'Config/routes.php');
                    
20        $this->routes = ( ! isset($ROUTE) OR ! is_array($ROUTE)) ? array() : $ROUTE;
                    
30
                    
31            if(!file_exists(APPBASE.'Controllers/'.$this->default_controller.'.php')){
                    
32                showError(__T('Unable to load your default controller.  Please make sure the controller specified in your Routes.php file is valid.'));
                    
78                {
                    
79                    $val = preg_replace('#^'.$key.'$#', $val, $uri);
                    
80                }
                    
171            $strlen = strlen(_getScriptPath());
                    
172            $totallen = strlen($_SERVER['PHP_SELF']);
                    
173            return substr($_SERVER['PHP_SELF'],$strlen,$totallen);
                    
188
                    
189        $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI']));
                    
190
                    
                
modResource.class.php git://github.com/Dolibarr/dolibarr.git | PHP | 321 lines
                    
1<?php
                    
2/* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
                    
23 * 	\brief		Resource module descriptor.
                    
24 * 	\file		core/modules/modResource.class.php
                    
25 * 	\ingroup	resource
                    
27 */
                    
28include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php";
                    
29
                    
61		// (where XXX is value of numeric property 'numero' of module)
                    
62		$this->name = preg_replace('/^mod/i', '', get_class($this));
                    
63		// Module description
                    
80		// for specific path of parts (eg: /resource/core/modules/barcode)
                    
81		// for specific css file (eg: /resource/css/resource.css.php)
                    
82		$this->module_parts = array();
                    
87
                    
88		// Config pages. Put here list of php pages
                    
89		// stored into resource/admin directory, used to setup module.
                    
                
class.PDODAO.php git://github.com/ginatrapani/isosceles.git | PHP | 358 lines
                    
1<?php
                    
2/**
                    
48     * Constructor
                    
49     * @param array $cfg_vals Optionally override config.inc.php vals; needs 'table_prefix', 'GMT_offset', 'db_type',
                    
50     * 'db_socket', 'db_name', 'db_host', 'db_user', 'db_password'
                    
140        }
                    
141        $sql = preg_replace("/#prefix#/", self::$prefix, $sql);
                    
142        $sql = preg_replace("/#gmt_offset#/", self::$gmt_offset, $sql);
                    
338    /**
                    
339     * Converts a Database boolean to a PHP boolean
                    
340     * @param int $val
                    
                
QueryTester.class.php http://xe-core.googlecode.com/svn/trunk/ | PHP | 320 lines
                    
1<?php 
                    
2
                    
22		function getOldParserOutput($query_id, $xml_file){
                    
23			$cache_file = _TEST_PATH_ . "cache/".$query_id.'.cache.php';
                    
24			$parser = new OldXmlQueryParser();
                    
30		function cleanOutputAndAddArgs($outputString, $argsString = ''){
                    
31			$outputString = str_replace("<?php if(!defined('__ZBXE__')) exit();", "", $outputString);
                    
32			$outputString = str_replace("?>", "", $outputString);
                    
46			
                    
47			$output = preg_replace('/select/i', 'SELECT', $output);
                    
48			$output = preg_replace('/from/i', '<br/>FROM', $output);
                    
48			$output = preg_replace('/from/i', '<br/>FROM', $output);
                    
49			$output = preg_replace('/where/i', '<br/>WHERE', $output);			
                    
50			$output = preg_replace('/group by/i', '<br/>GROUP BY', $output);
                    
50			$output = preg_replace('/group by/i', '<br/>GROUP BY', $output);
                    
51			$output = preg_replace('/order by/i', '<br/>ORDER BY', $output);
                    
52			
                    
                
text_helper.php https://bitbucket.org/codeigniter_jp/ci-ja/ | PHP | 535 lines
                    
261			{
                    
262				$str = preg_replace("/({$delim})(".str_replace('\*', '\w*?', preg_quote($badword, '/')).")({$delim})/ie", "'\\1'.str_repeat('#', strlen('\\2')).'\\3'", $str);
                    
263			}
                    
288
                    
289		// Replace any existing PHP tags to temporary markers so they don't accidentally
                    
290		// break the string out of PHP, and thus, thwart the highlighting.
                    
292		$str = str_replace(array('<?', '?>', '<%', '%>', '\\', '</script>'),
                    
293							array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'), $str);
                    
294
                    
311		// Remove our artificially added PHP, and the syntax highlighting that came with it
                    
312		$str = preg_replace('/<span style="color: #([A-Z0-9]+)">&lt;\?php(&nbsp;| )/i', '<span style="color: #$1">', $str);
                    
313		$str = preg_replace('/(<span style="color: #[A-Z0-9]+">.*?)\?&gt;<\/span>\n<\/span>\n<\/code>/is', "$1</span>\n</span>\n</code>", $str);
                    
316		// Replace our markers back to PHP tags.
                    
317		$str = str_replace(array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),
                    
318							array('&lt;?', '?&gt;', '&lt;%', '%&gt;', '\\', '&lt;/script&gt;'), $str);
                    
                
TemplateTask.php https://github.com/yandod/candycane.git | PHP | 220 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP 5
                    
6 *
                    
6 *
                    
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
8 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
15 * @link          http://cakephp.org CakePHP(tm) Project
                    
16 * @since         CakePHP(tm) v 1.3
                    
16 * @since         CakePHP(tm) v 1.3
                    
17 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
18 */
                    
72		$separator = DS === '/' ? '/' : '\\\\';
                    
73		$core = preg_replace('#shells' . $separator . '$#', '', $core);
                    
74
                    
                
prop_html.php https://bitbucket.org/alex_poluektov/itech_test.git | PHP | 359 lines
                    
68
                    
69		$id = preg_replace("/[^a-z0-9]/i", '', $strHTMLControlName['VALUE']);
                    
70
                    
82			'height' => '200',
                    
83			'bAllowPhp' => false,
                    
84			'limitPhpAccess' => false,
                    
92			'bbCode' => false,
                    
93			'actionUrl' => '/bitrix/tools/html_editor_action.php',
                    
94			'siteId' => SITE_ID,
                    
143				<?
                    
144				$text_name = preg_replace("/([^a-z0-9])/is", "_", $strHTMLControlName["VALUE"]."[TEXT]");
                    
145				$text_type = preg_replace("/([^a-z0-9])/is", "_", $strHTMLControlName["VALUE"]."[TYPE]");
                    
                
update.php git://pkgs.fedoraproject.org/wordpress | PHP | 452 lines
                    
27	include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
                    
28	$php_version = phpversion();
                    
29
                    
49	if ( method_exists( $wpdb, 'db_version' ) )
                    
50		$mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version());
                    
51	else
                    
68		'version'           => $wp_version,
                    
69		'php'               => $php_version,
                    
70		'locale'            => $locale,
                    
160		case 'load-plugins.php' :
                    
161		case 'load-update.php' :
                    
162			$timeout = 3600; // 1 hour
                    
233function wp_update_themes() {
                    
234	include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
                    
235
                    
                
redirect.php https://bitbucket.org/ChendeyY/docklandsmedia.git | PHP | 453 lines
                    
1<?php
                    
2
                    
91
                    
92		// Sort it in PHP
                    
93		ksort( $items );
                    
234		// Make sure that the old URL is relative
                    
235		$url = preg_replace( '@^https?://(.*?)/@', '/', $url );
                    
236		$url = preg_replace( '@^https?://(.*?)$@', '/', $url );
                    
                
admin-db.php http://core.svn.wordpress.org/ | PHP | 386 lines
                    
1<?php
                    
2
                    
295		$link_visible = 'Y';
                    
296	$link_visibile = preg_replace('/[^YNyn]/', '', $link_visible);
                    
297
                    
                
SQLBuilder.php git://github.com/machuga/php-activerecord-spark.git | PHP | 423 lines
                    
1<?php
                    
2/**
                    
194			if (strpos($v,' asc') !== false)
                    
195				$parts[$i] = preg_replace('/asc/i','DESC',$parts[$i]);
                    
196			elseif (strpos($v,' desc') !== false)
                    
196			elseif (strpos($v,' desc') !== false)
                    
197				$parts[$i] = preg_replace('/desc/i','ASC',$parts[$i]);
                    
198			else
                    
225			if ($i >= 2)
                    
226				$conditions[0] .= preg_replace(array('/_and_/i','/_or_/i'),array(' AND ',' OR '),$parts[$i-1]);
                    
227
                    
293	{
                    
294		require_once 'Expressions.php';
                    
295		$num_args = count($args);
                    
347	{
                    
348		require_once 'Expressions.php';
                    
349		$keys = join(',',$this->quoted_key_names());
                    
                
api_functions.php https://github.com/openaustralia/twfy.git | PHP | 371 lines
                    
2
                    
3include_once '../../../../phplib/rabx.php';
                    
4
                    
126	$query = $_SERVER['REQUEST_URI'];
                    
127	$query = preg_replace('#key=[A-Za-z0-9]+&?#', '', $query);
                    
128	$db = new ParlDB;
                    
190		$out .= '<result>' . api_output_xml($arr) . '</result>';
                    
191	} elseif ($output == 'php') {
                    
192		$out = api_output_php($arr);
                    
215		$type = 'text/xml';
                    
216	} elseif ($o == 'php') {
                    
217		$type = 'text/php';
                    
233
                    
234function api_output_php($arr) {
                    
235	$out = serialize($arr);
                    
                
LimeError.php git://github.com/bschussek/lime.git | PHP | 236 lines
                    
1<?php
                    
2
                    
15 *
                    
16 * This class is similar to PHP's native Exception class, but is guaranteed
                    
17 * to be serializable. The native Exception class is not serializable if the
                    
21 * @author     Bernhard Schussek <bernhard.schussek@symfony-project.com>
                    
22 * @version    SVN: $Id: LimeError.php 23701 2009-11-08 21:23:40Z bschussek $
                    
23 */
                    
117      {
                    
118        $_trace['file'] = preg_replace('/~annotated$/', '', $_trace['file']);
                    
119      }
                    
121
                    
122    $file = preg_replace('/~annotated$/', '', $file);
                    
123
                    
                
base.php git://github.com/jaz303/base-php.git | PHP | 218 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * base.php
                    
4 */
                    
56 *
                    
57 * @package BasePHP
                    
58 */
                    
109 * Callbacks are invokable objects providing a common interface to the numerous
                    
110 * PHP callback types.
                    
111 *
                    
112 * @author Jason Frame
                    
113 * @package BasePHP
                    
114 */
                    
180    public static function underscore($string) {
                    
181        return strtolower(preg_replace('/([^^])([A-Z])/e', '\1_\2', $string));
                    
182    }
                    
                
MY_Model.php git://github.com/pyrocms/pyrocms.git | PHP | 660 lines
                    
1<?php
                    
2
                    
605		{
                    
606			$class = preg_replace('/(_m|_model)?$/', '', get_class($this));
                    
607
                    
                
Onlines.php https://hg.codeplex.com/traviant4 | PHP | 200 lines
                    
1<?php
                    
2$active = $admin->getUserActive(); 
                    
5	<ul class="tabs"><center>
                    
6		<li>???????? ?????? (<?php echo count($active);?>)</li>
                    
7        </center>
                    
20    </tr>
                    
21<?php
                    
22	$time = time() - (60*5);
                    
25	if (isset($_GET['page'])) { // ?????? ????? ????
                    
26		$page = preg_replace('#[^0-9]#i', '', $_GET['page']); // ????? ???? ??? ??? ?? ?? ?????
                    
27	} else {
                    
196	<div class="paginator">
                    
197    <?php echo $paginationDisplay; ?>
                    
198    </div>
                    
                
GetFileController.php https://gitlab.com/casiazul/colectivoweb.git | PHP | 314 lines
                    
1<?php
                    
2/*
                    
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
                    
22*  @copyright  2007-2013 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
                    
39				die(Tools::displayError());
                    
40			$file = _PS_DOWNLOAD_DIR_.strval(preg_replace('/\.{2,}/', '.', $filename));
                    
41			$filename = ProductDownload::getFilenameFromFilename(Tools::getValue('file'));
                    
51			if (!file_exists($file))
                    
52				Tools::redirect('index.php');
                    
53		}
                    
60			if (!$this->context->customer->isLogged() && !Tools::getValue('secure_key') && !Tools::getValue('id_order'))
                    
61				Tools::redirect('index.php?controller=authentication&back=get-file.php&key='.$key);
                    
62			else if (!$this->context->customer->isLogged() && Tools::getValue('secure_key') && Tools::getValue('id_order'))
                    
                
DomQuery.php git://github.com/pmjones/php-framework-benchmarks.git | PHP | 405 lines
                    
23/** @see PHPUnit_Framework_Constraint */
                    
24require_once 'PHPUnit/Framework/Constraint.php';
                    
25
                    
38 */
                    
39class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint
                    
40{
                    
172                if (3 > $argc) {
                    
173                    require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
                    
174                    throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match');
                    
183                if (3 > $argc) {
                    
184                    require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
                    
185                    throw new Zend_Test_PHPUnit_Constraint_Exception('No count provided against which to compare');
                    
210    {
                    
211        require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
                    
212        switch ($this->_assertType) {
                    
                
File.php git://github.com/concrete5/concrete5.git | PHP | 513 lines
                    
1<?php
                    
2namespace Concrete\Core\File\Service;
                    
50                        }
                    
51                        $aDir[] = preg_replace("/\/\//si", '/', $file);
                    
52                    } else {
                    
55                        }
                    
56                        $aDir[] = preg_replace("/\/\//si", '/', $file);
                    
57                    }
                    
374        // Let's keep only letters, numbers, underscore and dots.
                    
375        $asciiName = trim(preg_replace(["/[\\s]/", "/[^0-9A-Z_a-z-.]/"], ["_", ""], $asciiName));
                    
376        // Trim underscores at start and end
                    
                
DateTime.php git://github.com/concrete5/concrete5.git | PHP | 455 lines
                    
1<?php
                    
2namespace Concrete\Core\Form\Service\Widget;
                    
5use Concrete\Core\Support\Facade\Application;
                    
6use DateTime as PHPDateTime;
                    
7use Exception;
                    
58                    try {
                    
59                        $datetime = new PHPDateTime($value, $dh->getTimezone('user'));
                    
60                    } catch (Exception $foo) {
                    
67                    try {
                    
68                        $datetime = new PHPDateTime($value, $systemTimezone);
                    
69                    } catch (Exception $foo) {
                    
126        }
                    
127        $id = trim(preg_replace('/[^0-9A-Za-z-]+/', '_', $field), '_');
                    
128
                    
136            if ($value) {
                    
137                if ($value instanceof PHPDateTime) {
                    
138                    $dateTime = clone $value;
                    
                
Services_Format_Parsing.php git://github.com/spotweb/spotweb.git | PHP | 556 lines
                    
1<?php
                    
2
                    
28         */
                    
29        $xmlStr = preg_replace('/[\x00-\x1F]/', '', $xmlStr);
                    
30
                    
63    {
                    
64        return preg_replace('%(?:
                    
65          \xF0[\x90-\xBF][\x80-\xBF]{2}      # planes 1-3
                    
                
WebAssert.php git://github.com/Behat/Mink.git | PHP | 748 lines
                    
1<?php
                    
2
                    
157        $actual = $this->session->getPage()->getText();
                    
158        $actual = preg_replace('/\s+/u', ' ', $actual);
                    
159        $regex  = '/'.preg_quote($text, '/').'/ui';
                    
174        $actual = $this->session->getPage()->getText();
                    
175        $actual = preg_replace('/\s+/u', ' ', $actual);
                    
176        $regex  = '/'.preg_quote($text, '/').'/ui';
                    
                
_compasscompat.scss git://github.com/silverstripe/sapphire.git | Sass | 1838 lines
                    
2
                    
3/*<?php
                    
4// *************
                    
4// *************
                    
5// Self-generating. Run with PHP on the command line to re-generate.
                    
6// *************
                    
8// Make sure we're being run in the CLI
                    
9if (php_sapi_name() != 'cli') die;
                    
10
                    
73$output = file_get_contents(__FILE__);
                    
74$output = preg_replace('{\*'.'/.*}', '*'.'/', $output);
                    
75
                    
                
ezoeinputparser.php git://github.com/ezsystems/ezpublish.git | PHP | 1553 lines
                    
1<?php
                    
2//
                    
31
                    
32/*! \file ezoeinputparser.php
                    
33*/
                    
204    {
                    
205        $text = preg_replace( '#<!--.*?-->#s', '', $text ); // remove HTML comments
                    
206        $text = str_replace( array( '&nbsp;', '&#160;', '&#xa0;' ), "\xC2\xA0", $text );
                    
                
DeclarationList.php git://github.com/peteboere/css-crush.git | PHP | 598 lines
                    
1<?php
                    
2/**
                    
256                        // Make swaps.
                    
257                        $copy->value = preg_replace(
                    
258                            $replacements['find'],
                    
289                        // Make swaps.
                    
290                        $copy->value = preg_replace(
                    
291                            Regex::make("~{{ LB }}$fn_name(?=\()~iS"),
                    
                
class.installer.php git://github.com/symphonycms/symphony-2.git | PHP | 750 lines
                    
1<?php
                    
2
                    
28        // Include the default Config for installation.
                    
29        include(INSTALL . '/includes/config_default.php');
                    
30        static::initialiseConfiguration($settings);
                    
71    {
                    
72        $lang = !empty($_REQUEST['lang']) ? preg_replace('/[^a-zA-Z\-]/', null, $_REQUEST['lang']) : 'en';
                    
73        Lang::initialize();
                    
185     * This function checks the server can support a Symphony installation.
                    
186     * It checks that PHP is 5.2+, MySQL, Zlib, LibXML, XSLT modules are enabled
                    
187     * and a `install.sql` file exists.
                    
195        $errors = [];
                    
196        $phpVc = new VersionComparator(phpversion());
                    
197
                    
201                'msg' => __('PHP Version is not correct'),
                    
202                'details' => __('Symphony requires %1$s or greater to work, however version %2$s was detected.', ['<code><abbr title="PHP: Hypertext Pre-processor">PHP</abbr> 5.6</code>', '<code>' . phpversion() . '</code>'])
                    
203            ];
                    
                
Git.php git://github.com/composer/composer.git | PHP | 408 lines
                    
1<?php
                    
2
                    
80                }
                    
81                $messages[] = '- ' . $protoUrl . "\n" . preg_replace('#^#m', '  ', $this->process->getErrorOutput());
                    
82                if ($initialClone && isset($origCwd)) {
                    
260                $commandCallable = function ($url) {
                    
261                    $sanitizedUrl = preg_replace('{://([^@]+?):(.+?)@}', '://', $url);
                    
262
                    
                
JsonManipulator.php git://github.com/composer/composer.git | PHP | 534 lines
                    
1<?php
                    
2
                    
78            $packageRegex = str_replace('/', '\\\\?/', preg_quote($existingPackage));
                    
79            $links = preg_replace_callback('{'.self::$DEFINES.'"'.$packageRegex.'"(?P<separator>\s*:\s*)(?&string)}ix', function ($m) use ($existingPackage, $constraint) {
                    
80                return JsonFile::encode(str_replace('\\/', '/', $existingPackage)) . $m['separator'] . '"' . $constraint . '"';
                    
84                // link missing but non empty links
                    
85                $links = preg_replace(
                    
86                    '{'.preg_quote($match[1]).'$}',
                    
86                    '{'.preg_quote($match[1]).'$}',
                    
87                    // addcslashes is used to double up backslashes/$ since preg_replace resolves them as back references otherwise, see #1588
                    
88                    addcslashes(',' . $this->newline . $this->indent . $this->indent . JsonFile::encode($package).': '.JsonFile::encode($constraint) . $match[1], '\\$'),
                    
110    /**
                    
111     * Sorts packages by importance (platform packages first, then PHP dependencies) and alphabetically.
                    
112     *
                    
120            if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $requirement)) {
                    
121                return preg_replace(
                    
122                    array(
                    
                
GitLabDriver.php git://github.com/composer/composer.git | PHP | 582 lines
                    
1<?php
                    
2
                    
104        $this->namespace = implode('/', $urlParts);
                    
105        $this->repository = preg_replace('#(\.git)$#', '', $match['repo']);
                    
106
                    
                
Problem.php git://github.com/composer/composer.git | PHP | 397 lines
                    
1<?php
                    
2
                    
103            if (in_array($rule->getReason(), $deduplicatableRuleTypes, true) && preg_match('{^(?P<package>\S+) (?P<version>\S+) (?P<type>requires|conflicts)}', $message, $m)) {
                    
104                $template = preg_replace('{^\S+ \S+ }', '%s%s ', $message);
                    
105                $messages[] = $template;
                    
121                        // remove the s from requires/conflicts to correct grammar
                    
122                        $message = preg_replace('{^(%s%s (?:require|conflict))s}', '$1', $message);
                    
123                        $result[] = sprintf($message, $package, '['.implode(', ', $versions).']');
                    
174        // handle php/hhvm
                    
175        if ($packageName === 'php' || $packageName === 'php-64bit' || $packageName === 'hhvm') {
                    
176            $version = phpversion();
                    
194            if ($packageName === 'hhvm') {
                    
195                return array($msg, 'you are running this with PHP and not HHVM.');
                    
196            }
                    
209
                    
210            return array("- Root composer.json requires PHP extension ".$packageName.self::constraintToText($constraint).' but ', $error.'. Install or enable PHP\'s '.$ext.' extension.');
                    
211        }
                    
                
GitDownloaderTest.php git://github.com/composer/composer.git | PHP | 744 lines
                    
1<?php
                    
2
                    
170        $this->setupConfig($config);
                    
171        $cachePath = $config->get('cache-vcs-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', 'https://example.com/composer/composer').'/';
                    
172
                    
                
smarty_cacheresource_keyvaluestore.php git://github.com/modxcms/revolution.git | PHP | 538 lines
                    
1<?php
                    
2/**
                    
250        }
                    
251        return preg_replace('#[^\w\|]+#S', '_', $string);
                    
252    }
                    
                
driver.php git://github.com/joomla/joomla-platform.git | PHP | 1706 lines
                    
1<?php
                    
2/**
                    
192
                    
193			// Only load for php files.
                    
194			// Note: DirectoryIterator::getExtension only available PHP >= 5.3.6
                    
194			// Note: DirectoryIterator::getExtension only available PHP >= 5.3.6
                    
195			if (!$file->isFile() || substr($fileName, strrpos($fileName, '.') + 1) != 'php')
                    
196			{
                    
200			// Derive the class name from the type.
                    
201			$class = str_ireplace('.php', '', 'JDatabaseDriver' . ucfirst(trim($fileName)));
                    
202
                    
212				// Connector names should not have file extensions.
                    
213				$connectors[] = str_ireplace('.php', '', $fileName);
                    
214			}
                    
238		// Sanitize the database connector options.
                    
239		$options['driver']   = (isset($options['driver'])) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $options['driver']) : 'mysqli';
                    
240		$options['database'] = (isset($options['database'])) ? $options['database'] : null;
                    
                
form.php git://github.com/joomla/joomla-platform.git | PHP | 792 lines
                    
1<?php
                    
2/**
                    
109			// @TODO Probably worth moving to an inflector class based on
                    
110			// http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
                    
111
                    
126				{
                    
127					$this->view_list = preg_replace($pattern[0], $pattern[1], $this->view_item);
                    
128					break;
                    
159				JRoute::_(
                    
160					'index.php?option=' . $this->option . '&view=' . $this->view_list
                    
161					. $this->getRedirectToListAppend(), false
                    
173			JRoute::_(
                    
174				'index.php?option=' . $this->option . '&view=' . $this->view_item
                    
175				. $this->getRedirectToItemAppend(), false
                    
326					JRoute::_(
                    
327						'index.php?option=' . $this->option . '&view=' . $this->view_list
                    
328						. $this->getRedirectToListAppend(), false
                    
                
file.php git://github.com/joomla/joomla-platform.git | PHP | 797 lines
                    
1<?php
                    
2/**
                    
72		$manifestPath = JPath::clean($this->parent->getPath('manifest'));
                    
73		$element = preg_replace('/\.xml/', '', basename($manifestPath));
                    
74		$this->set('element', $element);
                    
                
TextData.php git://github.com/moodle/moodle.git | PHP | 652 lines
                    
8    define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
                    
9    require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
                    
10}
                    
281            if (is_bool($haystack)) {
                    
282                $haystack = ($haystack) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
                    
283            }
                    
381        if (is_bool($value)) {
                    
382            $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
                    
383        }
                    
409        if (is_bool($value)) {
                    
410            $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
                    
411        }
                    
431        if (is_bool($value)) {
                    
432            $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
                    
433  
                    
                
LookupRef.php git://github.com/moodle/moodle.git | PHP | 879 lines
                    
3/** PHPExcel root directory */
                    
4if (!defined('PHPEXCEL_ROOT')) {
                    
5    /**
                    
8    define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
                    
9    require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
                    
10}
                    
32 * @package        PHPExcel_Calculation
                    
33 * @copyright    Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
                    
34 * @license        http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
                    
137            } else {
                    
138                $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress);
                    
139                return (integer) PHPExcel_Cell::columnIndexFromString($cellAddress);
                    
333
                    
334            return PHPExcel_Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false);
                    
335        }
                    
                
Parser.php git://github.com/moodle/moodle.git | PHP | 2628 lines
                    
28		'cache_dir'				=> null,
                    
29		'cache_method'			=> 'php', 			// false, 'serialize', 'php', 'var_export', 'callback';
                    
30		'cache_callback_get'	=> null,
                    
213			if( Less_Parser::$options['compress'] ){
                    
214				$css = preg_replace('/(^(\s)+)|((\s)+$)/', '', $css);
                    
215			}
                    
220
                    
221		//reset php settings
                    
222		@ini_set('precision',$precision);
                    
442			}
                    
443			throw new Less_Exception_Parser('Less.php cache directory couldn\'t be created: '.$dir);
                    
444
                    
448		}elseif( !is_writable($dir) ){
                    
449			throw new Less_Exception_Parser('Less.php cache directory isn\'t writable: '.$dir);
                    
450
                    
                
datadict-postgres.inc.php git://github.com/moodle/moodle.git | PHP | 484 lines
                    
1<?php
                    
2
                    
139			if (($not_null = preg_match('/NOT NULL/i',$v))) {
                    
140				$v = preg_replace('/NOT NULL/i','',$v);
                    
141			}
                    
197				if ($not_null = preg_match('/NOT NULL/i',$v)) {
                    
198					$v = preg_replace('/NOT NULL/i','',$v);
                    
199				}
                    
206					// the default value
                    
207					$v = preg_replace('/(?<!DEFAULT)\sNULL/i','',$v);
                    
208				}
                    
219					}
                    
220					$v = preg_replace('/^' . preg_quote($colname) . '\s/', '', $v);
                    
221					$t = trim(str_replace('DEFAULT '.$default,'',$v));
                    
                
AQueryWriter.php git://github.com/gabordemooij/redbean.git | PHP | 1661 lines
                    
1<?php
                    
2
                    
4
                    
5use RedBeanPHP\Adapter\DBAdapter as DBAdapter;
                    
6use RedBeanPHP\RedException as RedException;
                    
6use RedBeanPHP\RedException as RedException;
                    
7use RedBeanPHP\QueryWriter as QueryWriter;
                    
8use RedBeanPHP\OODBBean as OODBBean;
                    
8use RedBeanPHP\OODBBean as OODBBean;
                    
9use RedBeanPHP\RedException\SQL as SQLException;
                    
10
                    
11/**
                    
12 * RedBeanPHP Abstract Query Writer.
                    
13 * Represents an abstract Database to RedBean
                    
17 *
                    
18 * @file    RedBeanPHP/QueryWriter/AQueryWriter.php
                    
19 * @author  Gabor de Mooij and the RedBeanPHP Community
                    
                
Model.php git://github.com/forkcms/forkcms.git | PHP | 913 lines
                    
1<?php
                    
2
                    
117    {
                    
118        return mb_strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $string));
                    
119    }
                    
                
CSSmin.php git://github.com/moodle/moodle.git | PHP | 777 lines
                    
1<?php
                    
2
                    
3/*!
                    
4 * cssmin.php v2.4.8-4
                    
5 * Author: Tubal Martin - http://tubalmartin.me/
                    
5 * Author: Tubal Martin - http://tubalmartin.me/
                    
6 * Repo: https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port
                    
7 *
                    
7 *
                    
8 * This is a PHP port of the CSS minification tool distributed with YUICompressor,
                    
9 * itself a port of the cssmin utility by Isaac Schlueter - http://foohack.com/
                    
50
                    
51        $this->raise_php_limits = (bool) $raise_php_limits;
                    
52    }
                    
95        // Let's divide css code in chunks of 5.000 chars aprox.
                    
96        // Reason: PHP's PCRE functions like preg_replace have a "backtrack limit"
                    
97        // of 100.000 chars by default (php < 5.3.7) so if we're dealing with really
                    
                
datalib_test.php git://github.com/moodle/moodle.git | PHP | 656 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
17/**
                    
18 * Test for various bits of datalib.php.
                    
19 *
                    
20 * @package   core
                    
21 * @category  phpunit
                    
22 * @copyright 2012 The Open University
                    
29/**
                    
30 * Test for various bits of datalib.php.
                    
31 *
                    
32 * @package   core
                    
33 * @category  phpunit
                    
34 * @copyright 2012 The Open University
                    
38    protected function normalise_sql($sort) {
                    
39        return preg_replace('~\s+~', ' ', $sort);
                    
40    }
                    
                
store.php git://github.com/moodle/moodle.git | PHP | 401 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
71            $replace = "module = 'course' AND action = 'new' AND userid = :userid AND url = :url AND time > :since";
                    
72            $params += array('url' => "view.php?id={$params['courseid']}");
                    
73            return array($replace, $params, $sort);
                    
88        // Replace crud fields.
                    
89        $selectwhere = preg_replace_callback("/(crud).*?(<>|=|!=).*?'(.*?)'/s", 'self::replace_crud', $selectwhere);
                    
90
                    
285
                    
286        // If the 100 field size is changed, also need to alter print_log in course/lib.php.
                    
287        if (!empty($url) && \core_text::strlen($url) > 100) {
                    
325    /**
                    
326     * Generate a replace string for crud related sql conditions. This function is called as callback to preg_replace_callback()
                    
327     * on the actual sql.
                    
                
helper.php git://github.com/moodle/moodle.git | PHP | 593 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
25defined('MOODLE_INTERNAL') || die();
                    
26require_once($CFG->dirroot . '/cache/lib.php');
                    
27require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
                    
27require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
                    
28require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
                    
29
                    
58        $callback = partial(array('tool_uploadcourse_helper', 'generate_shortname_callback'), $fullname, $idnumber);
                    
59        $result = preg_replace_callback('/(?<!%)%([+~-])?(\d)*([fi])/', $callback, $templateshortname);
                    
60
                    
76     * @param string $idnumber ID number.
                    
77     * @param array $block result from preg_replace_callback.
                    
78     * @return string
                    
                
PhabricatorRepository.php git://github.com/facebook/phabricator.git | PHP | 2844 lines
                    
1<?php
                    
2
                    
227    // Convert any extra slashes ("//") in the path to a single slash ("/").
                    
228    $path = preg_replace('(//+)', '/', $path);
                    
229
                    
347      $name = phutil_utf8_strtolower($name);
                    
348      $name = preg_replace('@[ -/:->]+@', '-', $name);
                    
349      $name = trim($name, '-');
                    
                
lib.php git://github.com/moodle/moodle.git | PHP | 787 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
154        } else {
                    
155            $path = make_cache_directory('cachestore_file/'.preg_replace('#[^a-zA-Z0-9\.\-_]+#', '', $name));
                    
156        }
                    
267        $this->definition = $definition;
                    
268        $hash = preg_replace('#[^a-zA-Z0-9]+#', '_', $this->definition->get_id());
                    
269        $this->path = $this->filestorepath.'/'.$hash;
                    
                
DiffusionController.php git://github.com/facebook/phabricator.git | PHP | 571 lines
                    
1<?php
                    
2
                    
101      // If the short name ends in ".git", ignore it.
                    
102      $short_name = preg_replace('/\\.git\z/', '', $short_name);
                    
103      return $short_name;
                    
                
Dwoo.compiled.php git://github.com/daylightstudio/FUEL-CMS.git | PHP | 1 lines
                    
1<?php  define('DWOO_DIRECTORY', dirname(__FILE__) . DIRECTORY_SEPARATOR); class Dwoo_Core { const VERSION = '1.1.1'; const RELEASE_TAG = 17; const CLASS_PLUGIN = 1; const FUNC_PLUGIN = 2; const NATIVE_PLUGIN = 4; const BLOCK_PLUGIN = 8; const COMPILABLE_PLUGIN = 16; const CUSTOM_PLUGIN = 32; const SMARTY_MODIFIER = 64; const SMARTY_BLOCK = 128; const SMARTY_FUNCTION = 256; const PROXY_PLUGIN = 512; const TEMPLATE_PLUGIN = 1024; protected $charset = 'utf-8'; public $globals; protected $compileDir; protected $cacheDir; protected $cacheTime = 0; protected $securityPolicy = null; protected $plugins = array(); protected $filters = array(); protected $resources = array ( 'file' => array ( 'class' => 'Dwoo_Template_File', 'compiler' => null ), 'string' => array ( 'class' => 'Dwoo_Template_String', 'compiler' => null ) ); protected $loader = null; protected $template = null; protected $runtimePlugins; protected $returnData; public $data; public $scope; protected $scopeTree; protected $stack; protected $curBlock; protected $buffer; protected $pluginProxy; public function __construct($compileDir = null, $cacheDir = null) { if ($compileDir !== null) { $this->setCompileDir($compileDir); } if ($cacheDir !== null) { $this->setCacheDir($cacheDir); } $this->initGlobals(); } public function __clone() { $this->template = null; unset($this->data); unset($this->returnData); } public function output($tpl, $data = array(), Dwoo_ICompiler $compiler = null) { return $this->get($tpl, $data, $compiler, true); } public function get($_tpl, $data = array(), $_compiler = null, $_output = false) { if ($this->template instanceof Dwoo_ITemplate) { $clone = clone $this; return $clone->get($_tpl, $data, $_compiler, $_output); } if ($_tpl instanceof Dwoo_ITemplate) { } elseif (is_string($_tpl) && file_exists($_tpl)) { $_tpl = new Dwoo_Template_File($_tpl); } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s first argument must be a Dwoo_ITemplate (i.e. Dwoo_Template_File) or a valid path to a template file', E_USER_NOTICE); } $this->template = $_tpl; if ($data instanceof Dwoo_IDataProvider) { $this->data = $data->getData(); } elseif (is_array($data)) { $this->data = $data; } elseif ($data instanceof ArrayAccess) { $this->data = $data; } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s data argument must be a Dwoo_IDataProvider object (i.e. Dwoo_Data) or an associative array', E_USER_NOTICE); } $this->globals['template'] = $_tpl->getName(); $this->initRuntimeVars($_tpl); $file = $_tpl->getCachedTemplate($this); $doCache = $file === true; $cacheLoaded = is_string($file); if ($cacheLoaded === true) { if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { if ($doCache === true) { $dynamicId = uniqid(); } $compiledTemplate = $_tpl->getCompiledTemplate($this, $_compiler); $out = include $compiledTemplate; if ($out === false) { $_tpl->forceCompilation(); $compiledTemplate = $_tpl->getCompiledTemplate($this, $_compiler); $out = include $compiledTemplate; } if ($doCache === true) { $out = preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php /*'.$dynamicId.'*/ echo \'$1\'; ?>', $out); if (!class_exists('Dwoo_plugin_dynamic', false)) { $this->getLoader()->loadPlugin('dynamic'); } $out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId, $compiledTemplate); } foreach ($this->filters as $filter) { if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) { $out = call_user_func($filter, $out); } else { $out = call_user_func($filter, $this, $out); } } if ($doCache === true) { $file = $_tpl->cache($this, $out); if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { $this->template = null; if ($_output === true) { echo $out; } return $out; } } } protected function initGlobals() { $this->globals = array ( 'version' => self::VERSION, 'ad' => '<a href="http://dwoo.org/">Powered by Dwoo</a>', 'now' => $_SERVER['REQUEST_TIME'], 'charset' => $this->charset, ); } protected function initRuntimeVars(Dwoo_ITemplate $tpl) { $this->runtimePlugins = array(); $this->scope =& $this->data; $this->scopeTree = array(); $this->stack = array(); $this->curBlock = null; $this->buffer = ''; $this->returnData = array(); } public function addPlugin($name, $callback, $compilable = false) { $compilable = $compilable ? self::COMPILABLE_PLUGIN : 0; if (is_array($callback)) { if (is_subclass_of(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0])); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0]), 'function'=>$callback[1]); } } elseif (class_exists($callback, false)) { if (is_subclass_of($callback, 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback, 'function'=>($compilable ? 'compile' : 'process')); } } elseif (function_exists($callback)) { $this->plugins[$name] = array('type'=>self::FUNC_PLUGIN | $compilable, 'callback'=>$callback); } else { throw new Dwoo_Exception('Callback could not be processed correctly, please check that the function/class you used exists'); } } public function removePlugin($name) { if (isset($this->plugins[$name])) { unset($this->plugins[$name]); } } public function addFilter($callback, $autoload = false) { if ($autoload) { $class = 'Dwoo_Filter_'.$callback; if (!class_exists($class, false) && !function_exists($class)) { try { $this->getLoader()->loadPlugin($callback); } catch (Dwoo_Exception $e) { if (strstr($callback, 'Dwoo_Filter_')) { throw new Dwoo_Exception('Wrong filter name : '.$callback.', the "Dwoo_Filter_" prefix should not be used, please only use "'.str_replace('Dwoo_Filter_', '', $callback).'"'); } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } } } if (class_exists($class, false)) { $callback = array(new $class($this), 'process'); } elseif (function_exists($class)) { $callback = $class; } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } $this->filters[] = $callback; } else { $this->filters[] = $callback; } } public function removeFilter($callback) { if (($index = array_search('Dwoo_Filter_'.$callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } elseif (($index = array_search($callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } else { $class = 'Dwoo_Filter_' . $callback; foreach ($this->filters as $index=>$filter) { if (is_array($filter) && $filter[0] instanceof $class) { unset($this->filters[$index]); break; } } } } public function addResource($name, $class, $compilerFactory = null) { if (strlen($name) < 2) { throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths'); } if (!class_exists($class)) { throw new Dwoo_Exception('Resource class does not exist'); } $interfaces = class_implements($class); if (in_array('Dwoo_ITemplate', $interfaces) === false) { throw new Dwoo_Exception('Resource class must implement Dwoo_ITemplate'); } $this->resources[$name] = array('class'=>$class, 'compiler'=>$compilerFactory); } public function removeResource($name) { unset($this->resources[$name]); if ($name==='file') { $this->resources['file'] = array('class'=>'Dwoo_Template_File', 'compiler'=>null); } } public function setLoader(Dwoo_ILoader $loader) { $this->loader = $loader; } public function getLoader() { if ($this->loader === null) { $this->loader = new Dwoo_Loader($this->getCompileDir()); } return $this->loader; } public function getCustomPlugins() { return $this->plugins; } public function getCacheDir() { if ($this->cacheDir === null) { $this->setCacheDir(DWOO_DIRECTORY.'cache'.DIRECTORY_SEPARATOR); } return $this->cacheDir; } public function setCacheDir($dir) { $this->cacheDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->cacheDir) === false) { throw new Dwoo_Exception('The cache directory must be writable, chmod "'.$this->cacheDir.'" to make it writable'); } } public function getCompileDir() { if ($this->compileDir === null) { $this->setCompileDir(DWOO_DIRECTORY.'compiled'.DIRECTORY_SEPARATOR); } return $this->compileDir; } public function setCompileDir($dir) { $this->compileDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->compileDir) === false) { throw new Dwoo_Exception('The compile directory must be writable, chmod "'.$this->compileDir.'" to make it writable'); } } public function getCacheTime() { return $this->cacheTime; } public function setCacheTime($seconds) { $this->cacheTime = (int) $seconds; } public function getCharset() { return $this->charset; } public function setCharset($charset) { $this->charset = strtolower((string) $charset); } public function getTemplate() { return $this->template; } public function setTemplate(Dwoo_ITemplate $tpl) { $this->template = $tpl; } public function setDefaultCompilerFactory($resourceName, $compilerFactory) { $this->resources[$resourceName]['compiler'] = $compilerFactory; } public function getDefaultCompilerFactory($resourceName) { return $this->resources[$resourceName]['compiler']; } public function setSecurityPolicy(Dwoo_Security_Policy $policy = null) { $this->securityPolicy = $policy; } public function getSecurityPolicy() { return $this->securityPolicy; } public function setPluginProxy(Dwoo_IPluginProxy $pluginProxy) { $this->pluginProxy = $pluginProxy; } public function getPluginProxy() { return $this->pluginProxy; } public function isCached(Dwoo_ITemplate $tpl) { return is_string($tpl->getCachedTemplate($this)); } public function clearCache($olderThan=-1) { $cacheDirs = new RecursiveDirectoryIterator($this->getCacheDir()); $cache = new RecursiveIteratorIterator($cacheDirs); $expired = time() - $olderThan; $count = 0; foreach ($cache as $file) { if ($cache->isDot() || $cache->isDir() || substr($file, -5) !== '.html') { continue; } if ($cache->getCTime() < $expired) { $count += unlink((string) $file) ? 1 : 0; } } return $count; } public function templateFactory($resourceName, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (isset($this->resources[$resourceName])) { return call_user_func(array($this->resources[$resourceName]['class'], 'templateFactory'), $this, $resourceId, $cacheTime, $cacheId, $compileId, $parentTemplate); } else { throw new Dwoo_Exception('Unknown resource type : '.$resourceName); } } public function isArray($value, $checkIsEmpty=false) { if (is_array($value) === true || $value instanceof ArrayAccess) { if ($checkIsEmpty === false) { return true; } else { return $this->count($value); } } } public function isTraversable($value, $checkIsEmpty=false) { if (is_array($value) === true) { if ($checkIsEmpty === false) { return true; } else { return count($value) > 0; } } elseif ($value instanceof Traversable) { if ($checkIsEmpty === false) { return true; } else { return $this->count($value); } } return false; } public function count($value) { if (is_array($value) === true || $value instanceof Countable) { return count($value); } elseif ($value instanceof ArrayAccess) { if ($value->offsetExists(0)) { return true; } } elseif ($value instanceof Iterator) { $value->rewind(); if ($value->valid()) { return true; } } elseif ($value instanceof Traversable) { foreach ($value as $dummy) { return true; } } return 0; } public function triggerError($message, $level=E_USER_NOTICE) { if (!($tplIdentifier = $this->template->getResourceIdentifier())) { $tplIdentifier = $this->template->getResourceName(); } trigger_error('Dwoo error (in '.$tplIdentifier.') : '.$message, $level); } public function addStack($blockName, array $args=array()) { if (isset($this->plugins[$blockName])) { $class = $this->plugins[$blockName]['class']; } else { $class = 'Dwoo_Plugin_'.$blockName; } if ($this->curBlock !== null) { $this->curBlock->buffer(ob_get_contents()); ob_clean(); } else { $this->buffer .= ob_get_contents(); ob_clean(); } $block = new $class($this); $cnt = count($args); if ($cnt===0) { $block->init(); } elseif ($cnt===1) { $block->init($args[0]); } elseif ($cnt===2) { $block->init($args[0], $args[1]); } elseif ($cnt===3) { $block->init($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $block->init($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($block,'init'), $args); } $this->stack[] = $this->curBlock = $block; return $block; } public function delStack() { $args = func_get_args(); $this->curBlock->buffer(ob_get_contents()); ob_clean(); $cnt = count($args); if ($cnt===0) { $this->curBlock->end(); } elseif ($cnt===1) { $this->curBlock->end($args[0]); } elseif ($cnt===2) { $this->curBlock->end($args[0], $args[1]); } elseif ($cnt===3) { $this->curBlock->end($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $this->curBlock->end($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($this->curBlock, 'end'), $args); } $tmp = array_pop($this->stack); if (count($this->stack) > 0) { $this->curBlock = end($this->stack); $this->curBlock->buffer($tmp->process()); } else { $this->curBlock = null; echo $tmp->process(); } unset($tmp); } public function getParentBlock(Dwoo_Block_Plugin $block) { $index = array_search($block, $this->stack, true); if ($index !== false && $index > 0) { return $this->stack[$index-1]; } return false; } public function findBlock($type) { if (isset($this->plugins[$type])) { $type = $this->plugins[$type]['class']; } else { $type = 'Dwoo_Plugin_'.str_replace('Dwoo_Plugin_', '', $type); } $keys = array_keys($this->stack); while (($key = array_pop($keys)) !== false) { if ($this->stack[$key] instanceof $type) { return $this->stack[$key]; } } return false; } public function getObjectPlugin($class) { if (isset($this->runtimePlugins[$class])) { return $this->runtimePlugins[$class]; } return $this->runtimePlugins[$class] = new $class($this); } public function classCall($plugName, array $params = array()) { $class = 'Dwoo_Plugin_'.$plugName; $plugin = $this->getObjectPlugin($class); $cnt = count($params); if ($cnt===0) { return $plugin->process(); } elseif ($cnt===1) { return $plugin->process($params[0]); } elseif ($cnt===2) { return $plugin->process($params[0], $params[1]); } elseif ($cnt===3) { 
                    
                
markdown_helper.php git://github.com/daylightstudio/FUEL-CMS.git | PHP | 1738 lines
                    
1<?php
                    
2#
                    
4#
                    
5# PHP Markdown
                    
6# Copyright (c) 2004-2012 Michel Fortin  
                    
6# Copyright (c) 2004-2012 Michel Fortin  
                    
7# <http://michelf.com/projects/php-markdown/>
                    
8#
                    
64Plugin Name: Markdown
                    
65Plugin URI: http://michelf.com/projects/php-markdown/
                    
66Description: <a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a> allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by <a href="http://daringfireball.net/">John Gruber</a>. <a href="http://michelf.com/projects/php-markdown/">More...</a>
                    
122			$text = '<p>'.$text.'</p>';
                    
123			$text = preg_replace('{\n{2,}}', "</p>\n\n<p>", $text);
                    
124		}
                    
127	
                    
128	function mdwp_strip_p($t) { return preg_replace('{</?p>}i', '', $t); }
                    
129
                    
                
UrlGenerator.php git://github.com/drupal/drupal.git | PHP | 455 lines
                    
1<?php
                    
2
                    
136    // is handled in processPath().
                    
137    $path = preg_replace('/\?.*/', '', $path);
                    
138    return trim($path, '/');
                    
                
FileSystem.php git://github.com/drupal/drupal.git | PHP | 759 lines
                    
1<?php
                    
2
                    
76    $result = @move_uploaded_file($filename, $uri);
                    
77    // PHP's move_uploaded_file() does not properly support streams if
                    
78    // open_basedir is enabled so if the move failed, try finding a real path
                    
116  public function unlink($uri, $context = NULL) {
                    
117    if (!$this->streamWrapperManager->isValidUri($uri) && (substr(PHP_OS, 0, 3) == 'WIN')) {
                    
118      chmod($uri, 0600);
                    
132    // If this URI is a stream, pass it off to the appropriate stream wrapper.
                    
133    // Otherwise, attempt PHP's realpath. This allows use of this method even
                    
134    // for unmanaged files outside of the stream wrapper interface.
                    
171    if ($suffix) {
                    
172      $filename = preg_replace('@' . preg_quote($suffix, '@') . '$@', '', $filename);
                    
173    }
                    
257  public function rmdir($uri, $context = NULL) {
                    
258    if (!$this->streamWrapperManager->isValidUri($uri) && (substr(PHP_OS, 0, 3) == 'WIN')) {
                    
259      chmod($uri, 0700);
                    
                
DirectLex.php git://github.com/ushahidi/Ushahidi_Web.git | PHP | 490 lines
                    
1<?php
                    
2
                    
5 *
                    
6 * A pure PHP parser, DirectLex has absolutely no dependencies, making
                    
7 * it a reasonably good default for PHP4.  Written with efficiency in mind,
                    
36        if ($config->get('HTML.Trusted')) {
                    
37            $html = preg_replace_callback('#(<script[^>]*>)(\s*[^<].+?)(</script>)#si',
                    
38                array($this, 'scriptCallback'), $html);
                    
320    /**
                    
321     * PHP 5.0.x compatible substr_count that implements offset and length
                    
322     */
                    
325        if ($oldVersion === null) {
                    
326            $oldVersion = version_compare(PHP_VERSION, '5.1', '<');
                    
327        }
                    
                
Html.php git://github.com/drupal/drupal.git | PHP | 484 lines
                    
1<?php
                    
2
                    
123    // We strip out any character not in the above list.
                    
124    $identifier = preg_replace('/[^\x{002D}\x{0030}-\x{0039}\x{0041}-\x{005A}\x{005F}\x{0061}-\x{007A}\x{00A1}-\x{FFFF}]/u', '', $identifier);
                    
125    // Identifiers cannot start with a digit, two hyphens, or a hyphen followed by a digit.
                    
125    // Identifiers cannot start with a digit, two hyphens, or a hyphen followed by a digit.
                    
126    $identifier = preg_replace([
                    
127      '/^[0-9]/',
                    
226    // characters as well.
                    
227    $id = preg_replace('/[^A-Za-z0-9\-_]/', '', $id);
                    
228
                    
229    // Removing multiple consecutive hyphens.
                    
230    $id = preg_replace('/\-+/', '-', $id);
                    
231    return $id;
                    
281EOD;
                    
282    // PHP's \DOMDocument serialization adds extra whitespace when the markup
                    
283    // of the wrapping document contains newlines, so ensure we remove all
                    
                
CSSmin.php git://github.com/ushahidi/Ushahidi_Web.git | PHP | 741 lines
                    
10 * Isaac Schlueter - http://foohack.com/
                    
11 * Permission is hereby granted to use the PHP version under the same
                    
12 * conditions as the YUICompressor.
                    
55     */
                    
56    public function __construct($raise_php_limits = TRUE)
                    
57    {
                    
63
                    
64        $this->raise_php_limits = (bool) $raise_php_limits;
                    
65    }
                    
108        // Let's divide css code in chunks of 25.000 chars aprox.
                    
109        // Reason: PHP's PCRE functions like preg_replace have a "backtrack limit"
                    
110        // of 100.000 chars by default (php < 5.3.7) so if we're dealing with really
                    
266                        $this->preserved_tokens[] = '';
                    
267                        $css = preg_replace($placeholder,  self::TOKEN . (count($this->preserved_tokens) - 1) . '___', $css, 1);
                    
268                    }
                    
                
file.inc git://github.com/drupal/drupal.git | Pascal | 1248 lines
                    
1<?php
                    
2
                    
9use Drupal\Component\Utility\UrlHelper;
                    
10use Drupal\Component\PhpStorage\FileStorage;
                    
11use Drupal\Component\Utility\Bytes;
                    
110  // forward-slashes and backslashes.
                    
111  $target = trim(preg_replace('/^[\w\-]+:\/\/|^data:/', '', $uri), '\/');
                    
112
                    
263
                    
264  return preg_replace('|^https?://' . $http_host . '|', '', $file_url);
                    
265}
                    
386 * @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0.
                    
387 *   Use \Drupal\Component\PhpStorage\FileStorage::htaccessLines().
                    
388 */
                    
427 *   safe_mode or open_basedir are enabled.
                    
428 *   @see https://bugs.php.net/bug.php?id=60456
                    
429 *
                    
                
functions.php git://github.com/wordpress/wordpress.git | PHP | 7608 lines
                    
1<?php
                    
2/**
                    
7
                    
8require ABSPATH . WPINC . '/option.php';
                    
9
                    
12 *
                    
13 * `$format` should be a PHP date format string.
                    
14 * 'U' and 'G' formats will return a sum of timestamp with timezone offset.
                    
58 * and timezone offset, depending on `$gmt`.
                    
59 * Other strings will be interpreted as PHP date formats (e.g. 'Y-m-d').
                    
60 *
                    
66 * @param string   $type Type of time to retrieve. Accepts 'mysql', 'timestamp',
                    
67 *                       or PHP date format string (e.g. 'Y-m-d').
                    
68 * @param int|bool $gmt  Optional. Whether to use GMT timezone. Default false.
                    
105 *
                    
106 * @return string PHP timezone string or a ±HH:MM offset.
                    
107 */
                    
                
canonical.php git://github.com/wordpress/wordpress.git | PHP | 917 lines
                    
1<?php
                    
2/**
                    
94	 */
                    
95	$redirect['path'] = preg_replace( '|(%C2%A0)+$|i', '', $redirect['path'] );
                    
96
                    
113
                    
114			$redirect['path'] = parse_url( $redirect_url, PHP_URL_PATH );
                    
115		}
                    
424				// Strip off any existing paging.
                    
425				$redirect['path'] = preg_replace( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path'] );
                    
426				// Strip off feed endings.
                    
426				// Strip off feed endings.
                    
427				$redirect['path'] = preg_replace( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path'] );
                    
428				// Strip off any existing comment paging.
                    
428				// Strip off any existing comment paging.
                    
429				$redirect['path'] = preg_replace( "#/{$wp_rewrite->commen
                    
                
class-wp.php git://github.com/wordpress/wordpress.git | PHP | 756 lines
                    
1<?php
                    
2/**
                    
171			list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
                    
172			$self            = $_SERVER['PHP_SELF'];
                    
173			$home_path       = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );
                    
182			$req_uri  = trim( $req_uri, '/' );
                    
183			$req_uri  = preg_replace( $home_path_regex, '', $req_uri );
                    
184			$req_uri  = trim( $req_uri, '/' );
                    
185			$pathinfo = trim( $pathinfo, '/' );
                    
186			$pathinfo = preg_replace( $home_path_regex, '', $pathinfo );
                    
187			$pathinfo = trim( $pathinfo, '/' );
                    
188			$self     = trim( $self, '/' );
                    
189			$self     = preg_replace( $home_path_regex, '', $self );
                    
190			$self     = trim( $self, '/' );
                    
248				// Trim the query of everything up to the '?'.
                    
249				$query = preg_replace( '!^.+\?!', '', $query );
                    
250
                    
                
template.php git://github.com/wordpress/wordpress.git | PHP | 727 lines
                    
1<?php
                    
2/**
                    
23function get_query_template( $type, $templates = array() ) {
                    
24	$type = preg_replace( '|[^a-z0-9-]+|', '', $type );
                    
25
                    
26	if ( empty( $templates ) ) {
                    
27		$templates = array( "{$type}.php" );
                    
28	}
                    
116		$post_type   = reset( $post_types );
                    
117		$templates[] = "archive-{$post_type}.php";
                    
118	}
                    
118	}
                    
119	$templates[] = 'archive.php';
                    
120
                    
355function get_home_template() {
                    
356	$templates = array( 'home.php', 'index.php' );
                    
357
                    
                
Parser.php git://github.com/ci-bonfire/Bonfire.git | PHP | 741 lines
                    
55        $this->setupRegex();
                    
56        $this->allowPhp = $allowPhp;
                    
57
                    
73        // The parseConditionals method executes any PHP in the text, so clean it up.
                    
74        if (! $allowPhp) {
                    
75            $text = str_replace(array('<?', '?>'), array('&lt;?', '?&gt;'), $text);
                    
231                if (preg_match($nested_regex, $content.$match[0][0], $nested_matches)) {
                    
232                    $nested_content = preg_replace('/\{\{\s*\/'.preg_quote($name, '/').'\s*\}\}/m', '', $nested_matches[0]);
                    
233                    $content = $this->createExtraction('nested_looped_tags', $nested_content, $nested_content, $content);
                    
280            }
                    
281            $condition = preg_replace($this->conditionalNotRegex, '$1!$2', $condition);
                    
282
                    
332        $text = preg_replace($this->conditionalElseRegex, '<?php else: ?>', $text);
                    
333        $text = preg_replace($this->conditionalEndRegex, '<?php endif; ?>', $text);
                    
334
                    
                
load.php git://github.com/wordpress/wordpress.git | PHP | 1560 lines
                    
83	// Fix empty PHP_SELF.
                    
84	$PHP_SELF = $_SERVER['PHP_SELF'];
                    
85	if ( empty( $PHP_SELF ) ) {
                    
99 *
                    
100 * @global string $required_php_version The required PHP version string.
                    
101 * @global string $wp_version           The WordPress version string.
                    
104	global $required_php_version, $wp_version;
                    
105	$php_version = phpversion();
                    
106
                    
106
                    
107	if ( version_compare( $required_php_version, $php_version, '>' ) ) {
                    
108		$protocol = wp_get_server_protocol();
                    
110		header( 'Content-Type: text/html; charset=utf-8' );
                    
111		printf( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.', $php_version, $wp_version, $required_php_version );
                    
112		exit( 1 );
                    
                
nav-menu-template.php git://github.com/wordpress/wordpress.git | PHP | 620 lines
                    
1<?php
                    
2/**
                    
10/** Walker_Nav_Menu class */
                    
11require_once ABSPATH . WPINC . '/class-walker-nav-menu.php';
                    
12
                    
229			if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) {
                    
230				$wrap_id = preg_replace( '#-(\d+)$#', '-' . ++$matches[1], $wrap_id );
                    
231			} else {
                    
                
class-wp-widget.php git://github.com/wordpress/wordpress.git | PHP | 600 lines
                    
1<?php
                    
2/**
                    
17 * @since 2.8.0
                    
18 * @since 4.4.0 Moved to its own file from wp-includes/widgets.php
                    
19 */
                    
149	/**
                    
150	 * PHP5 constructor.
                    
151	 *
                    
162	public function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {
                    
163		$this->id_base         = empty( $id_base ) ? preg_replace( '/(wp_)?widget_/', '', strtolower( get_class( $this ) ) ) : strtolower( $id_base );
                    
164		$this->name            = $name;
                    
176	/**
                    
177	 * PHP4 constructor.
                    
178	 *
                    
                
ms-blogs.php git://github.com/wordpress/wordpress.git | PHP | 907 lines
                    
1<?php
                    
2
                    
10
                    
11require_once ABSPATH . WPINC . '/ms-site.php';
                    
12require_once ABSPATH . WPINC . '/ms-network.php';
                    
47
                    
48	$scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );
                    
49	$scheme = empty( $scheme ) ? 'http' : $scheme;
                    
68		if ( ! empty( $blogname ) ) {
                    
69			$url = preg_replace( '|^([^\.]+://)|', '${1}' . $blogname . '.', $url );
                    
70		}
                    
90	if ( is_subdomain_install() ) {
                    
91		$domain = $slug . '.' . preg_replace( '|^www\.|', '', $current_network->domain );
                    
92		$path   = $current_network->path;
                    
                
update.php git://github.com/wordpress/wordpress.git | PHP | 883 lines
                    
32	require ABSPATH . WPINC . '/version.php';
                    
33	$php_version = phpversion();
                    
34
                    
74	if ( method_exists( $wpdb, 'db_version' ) ) {
                    
75		$mysql_version = preg_replace( '/[^0-9.].*/', '', $wpdb->db_version() );
                    
76	} else {
                    
94		'version'            => $wp_version,
                    
95		'php'                => $php_version,
                    
96		'locale'             => $locale,
                    
116	 *     @type string $version            WordPress version number.
                    
117	 *     @type string $php                PHP version number.
                    
118	 *     @type string $locale             The locale to retrieve updates for.
                    
253 *
                    
254 * The WordPress version, PHP version, and Locale is sent along with a list of
                    
255 * all plugins installed. Checks against the WordPress server at
                    
                
shortcodes.php git://github.com/wordpress/wordpress.git | PHP | 671 lines
                    
1<?php
                    
2/**
                    
217	$pattern = get_shortcode_regex( $tagnames );
                    
218	$content = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $content );
                    
219
                    
259
                    
260	// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
                    
261	return '\\['                             // Opening bracket.
                    
288		. '(\\]?)';                          // 6: Optional second closing brocket for escaping shortcodes: [[tag]].
                    
289	// phpcs:enable
                    
290}
                    
413			if ( 1 === preg_match( '%^<\s*\[\[?[^\[\]]+\]%', $element ) ) {
                    
414				$element = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $element );
                    
415			}
                    
444				 */
                    
445				$attr = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $attr );
                    
446			} else {
                    
                
post-template.php git://github.com/wordpress/wordpress.git | PHP | 1951 lines
                    
1<?php
                    
2/**
                    
15 */
                    
16function the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
                    
17	echo get_the_ID();
                    
26 */
                    
27function get_the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
                    
28	$post = get_post();
                    
326			// Remove the core/more block delimiters. They will be left over after $content is split up.
                    
327			$content = preg_replace( '/<!-- \/?wp:more(.*?) -->/', '', $content );
                    
328		}
                    
                
Installer_lib.php git://github.com/ci-bonfire/Bonfire.git | PHP | 664 lines
                    
30
                    
31    /** @var string The version of the currently running PHP parser or extension. */
                    
32    public $php_version;
                    
71        $this->curl_update = $this->cURL_enabled();
                    
72        $this->php_version = phpversion();
                    
73    }
                    
102            if (strpos($fileOrFolder, 'public/') === 0) {
                    
103                $realpath = FCPATH . preg_replace('{^public/}', '', $fileOrFolder);
                    
104            } else {
                    
124    {
                    
125        return version_compare($this->php_version, $version, '>=');
                    
126    }
                    
266        // If the database config doesn't exist, the app is not installed
                    
267        if (defined('ENVIRONMENT') && is_file(APPPATH . 'config/' . ENVIRONMENT . '/database.php')) {
                    
268            require(APPPATH . 'config/' . ENVIRONMENT . '/database.php');
                    
                
media.php git://github.com/wordpress/wordpress.git | PHP | 3746 lines
                    
1<?php
                    
2/**
                    
88		} else {
                    
89			/** This filter is documented in wp-admin/media-upload.php */
                    
90			$current = apply_filters( 'media_upload_default_tab', $default );
                    
226	$caption = str_replace( array( "\r\n", "\r" ), "\n", $caption );
                    
227	$caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption );
                    
228
                    
229	// Convert any remaining line breaks to <br />.
                    
230	$caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption );
                    
231
                    
231
                    
232	$html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
                    
233	if ( empty( $align ) ) {
                    
250/**
                    
251 * Private preg_replace callback used in image_add_caption()
                    
252 *
                    
                
Developer.php git://github.com/ci-bonfire/Bonfire.git | PHP | 770 lines
                    
1<?php defined('BASEPATH') || exit('No direct script access allowed');
                    
2/**
                    
31{
                    
32    /** @var array The options from the /config/modulebuilder.php file. */
                    
33    private $options;
                    
178            // If the table name includes the prefix, remove the prefix
                    
179            $_POST['table_name'] = preg_replace(
                    
180                "/^".$this->db->dbprefix."/",
                    
288        // Drop the migration record - old Migration schema method
                    
289        $moduleNameLower = preg_replace("/[ -]/", "_", strtolower($moduleName));
                    
290        if ($this->db->field_exists("{$moduleNameLower}_version", 'schema_version')) {
                    
315        $modelName = "{$moduleName}_model";
                    
316        if (Modules::file_path($moduleName, 'models', "{$modelName}.php")) {
                    
317            // Drop the table
                    
                
network.php git://github.com/wordpress/wordpress.git | PHP | 679 lines
                    
1<?php
                    
2/**
                    
35function allow_subdomain_install() {
                    
36	$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
                    
37	if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) {
                    
230			<tr>
                    
231				<th><label><input type="radio" name="subdomain_install" value="1"<?php checked( $subdomain_install ); ?> /> <?php _e( 'Sub-domains' ); ?></label></th>
                    
232				<td>
                    
242			<tr>
                    
243				<th><label><input type="radio" name="subdomain_install" value="0"<?php checked( ! $subdomain_install ); ?> /> <?php _e( 'Sub-directories' ); ?></label></th>
                    
244				<td>
                    
398	$location_of_wp_config = $abspath_fix;
                    
399	if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) {
                    
400		$location_of_wp_config = dirname( $abspath_fix );
                    
423			?>
                    
424	<div class="error"><p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
                    
425	<p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>
                    
                
class-wp-filesystem-base.php git://github.com/wordpress/wordpress.git | PHP | 831 lines
                    
1<?php
                    
2/**
                    
201				if ( 0 === stripos( $folder, $dir ) ) { // $folder starts with $dir.
                    
202					$potential_folder = preg_replace( '#^' . preg_quote( $dir, '#' ) . '/#i', trailingslashit( constant( $constant ) ), $folder );
                    
203					$potential_folder = trailingslashit( $potential_folder );
                    
215
                    
216		$folder = preg_replace( '|^([a-z]{1}):|i', '', $folder ); // Strip out Windows drive letter if it's there.
                    
217		$folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation.
                    
320	 *
                    
321	 * From the PHP documentation page for fileperms().
                    
322	 *
                    
322	 *
                    
323	 * @link https://www.php.net/manual/en/function.fileperms.php
                    
324	 *
                    
390	 *
                    
391	 * @link https://www.php.net/manual/en/function.chmod.php#49614
                    
392	 *
                    
                
auth.php git://github.com/phpbb/phpbb.git | PHP | 1316 lines
                    
5*
                    
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
                    
7* @license GNU General Public License, version 2 (GPL-2.0)
                    
16*/
                    
17if (!defined('IN_PHPBB'))
                    
18{
                    
24*/
                    
25class auth_admin extends \phpbb\auth\auth
                    
26{
                    
106		// Only those options we need
                    
107		$compare_options = array_diff(preg_replace('/^((?!' . $auth_option . ').+)|(' . $auth_option . ')$/', '', array_keys($this->acl_options[$scope])), array(''));
                    
108
                    
270
                    
271		/* @var $phpbb_permissions \phpbb\permissions */
                    
272		$phpbb_permissions = $phpbb_container->get('acl.permissions');
                    
                
bbcode.php git://github.com/phpbb/phpbb.git | PHP | 705 lines
                    
3*
                    
4* This file is part of the phpBB Forum Software package.
                    
5*
                    
5*
                    
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
                    
7* @license GNU General Public License, version 2 (GPL-2.0)
                    
151	{
                    
152		global $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
                    
153
                    
162				new \phpbb\template\twig\environment(
                    
163					$phpbb_container->get('config'),
                    
164					$phpbb_container->get('filesystem'),
                    
164					$phpbb_container->get('filesystem'),
                    
165					$phpbb_container->get('path_helper'),
                    
166					$phpbb_container->getParameter('core.cache_dir'),
                    
                
functions_upload.php git://github.com/phpbb/phpbb.git | PHP | 1119 lines
                    
5*
                    
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
                    
7* @license GNU General Public License, version 2 (GPL-2.0)
                    
16*/
                    
17if (!defined('IN_PHPBB'))
                    
18{
                    
50	 * The plupload object
                    
51	 * @var \phpbb\plupload\plupload
                    
52	 */
                    
56	 * phpBB Mimetype guesser
                    
57	 * @var \phpbb\mimetype\guesser
                    
58	 */
                    
64	*/
                    
65	function filespec($upload_ary, $upload_namespace, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
                    
66	{
                    
                
functions_compress.php git://github.com/phpbb/phpbb.git | PHP | 830 lines
                    
51		{
                    
52			$this->data($src_path, file_get_contents("$phpbb_root_path$src"), stat("$phpbb_root_path$src"), false);
                    
53		}
                    
217		$this->fp = @fopen($file, $mode . 'b');
                    
218		$this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem();
                    
219
                    
298									{
                    
299										$this->filesystem->phpbb_chmod($str, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
                    
300									}
                    
335								{
                    
336									$this->filesystem->phpbb_chmod($str, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
                    
337								}
                    
584
                    
585		$this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem();
                    
586	}
                    
                
message_parser.php git://github.com/phpbb/phpbb.git | PHP | 2087 lines
                    
3*
                    
4* This file is part of the phpBB Forum Software package.
                    
5*
                    
5*
                    
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
                    
7* @license GNU General Public License, version 2 (GPL-2.0)
                    
24	// The following lines are for extensions which include message_parser.php
                    
25	// while $phpbb_root_path and $phpEx are out of the script scope
                    
26	// which may lead to the 'Undefined variable' and 'failed to open stream' errors
                    
31
                    
32	if (!isset($phpEx))
                    
33	{
                    
36
                    
37	include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
                    
38}
                    
                
edit.php git://github.com/wordpress/wordpress.git | PHP | 464 lines
                    
1<?php
                    
2/**
                    
9/** WordPress Administration Bootstrap */
                    
10require_once __DIR__ . '/admin.php';
                    
11
                    
20if ( 'attachment' === $typenow ) {
                    
21	if ( wp_redirect( admin_url( 'upload.php' ) ) ) {
                    
22		exit;
                    
52	if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
                    
53		wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
                    
54		exit;
                    
59if ( 'post' !== $post_type ) {
                    
60	$parent_file   = "edit.php?post_type=$post_type";
                    
61	$submenu_file  = "edit.php?post_type=$post_type";
                    
61	$submenu_file  = "edit.php?post_type=$post_type";
                    
62	$post_new_file = "post-new.php?post_type=$post_type";
                    
63} else {
                    
                
setup-config.php git://github.com/wordpress/wordpress.git | PHP | 459 lines
                    
61		'<p>' . sprintf(
                    
62			/* translators: 1: wp-config.php, 2: install.php */
                    
63			__( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ),
                    
74		'<p>' . sprintf(
                    
75			/* translators: 1: wp-config.php, 2: install.php */
                    
76			__( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ),
                    
182		printf(
                    
183			/* translators: 1: wp-config-sample.php, 2: wp-config.php */
                    
184			__( 'If for any reason this automatic file creation doesn&#8217;t work, don&#8217;t worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ),
                    
199
                    
200<p class="step"><a href="<?php echo $step_1; ?>" class="button button-large"><?php _e( 'Let&#8217;s go!' ); ?></a></p>
                    
201		<?php
                    
417<p><?php _e( 'After you&#8217;ve done that, click &#8220;Run the installation&#8221;.' ); ?></p>
                    
418<p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p>
                    
419<script>
                    
                
options-permalink.php git://github.com/wordpress/wordpress.git | PHP | 426 lines
                    
221	<tr>
                    
222		<th scope="row"><label><input name="selection" type="radio" value="" <?php checked( '', $permalink_structure ); ?> /> <?php _e( 'Plain' ); ?></label></th>
                    
223		<td><code><?php echo get_option( 'home' ); ?>/?p=123</code></td>
                    
225	<tr>
                    
226		<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[1] ); ?>" <?php checked( $structures[1], $permalink_structure ); ?> /> <?php _e( 'Day and name' ); ?></label></th>
                    
227		<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . gmdate( 'd' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
                    
229	<tr>
                    
230		<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[2] ); ?>" <?php checked( $structures[2], $permalink_structure ); ?> /> <?php _e( 'Month and name' ); ?></label></th>
                    
231		<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
                    
233	<tr>
                    
234		<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[3] ); ?>" <?php checked( $structures[3], $permalink_structure ); ?> /> <?php _e( 'Numeric' ); ?></label></th>
                    
235		<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>
                    
237	<tr>
                    
238		<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[4] ); ?>" <?php checked( $structures[4], $permalink_structure ); ?> /> <?php _e( 'Post name' ); ?></label></th>
                    
239		<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
                    
                
fulltext_postgres.php git://github.com/phpbb/phpbb.git | PHP | 1192 lines
                    
5*
                    
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
                    
7* @license GNU General Public License, version 2 (GPL-2.0)
                    
94	 * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
                    
95	 * @param string $phpbb_root_path Relative path to phpBB root
                    
96	 * @param string $phpEx PHP file extension
                    
102	 */
                    
103	public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher)
                    
104	{
                    
106		$this->db = $db;
                    
107		$this->phpbb_dispatcher = $phpbb_dispatcher;
                    
108		$this->user = $user;
                    
116		{
                    
117			include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
                    
118		}
                    
                
wp-signup.php git://github.com/wordpress/wordpress.git | PHP | 1014 lines
                    
37if ( ! is_main_site() ) {
                    
38	wp_redirect( network_site_url( 'wp-signup.php' ) );
                    
39	die();
                    
74	</style>
                    
75	<?php
                    
76}
                    
205				<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> />
                    
206				<strong><?php _e( 'Yes' ); ?></strong>
                    
207			</label>
                    
272	<?php } ?>
                    
273	<input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" /><br /><?php _e( 'We send your registration email to this address. (Double-check your email address before continuing.)' ); ?>
                    
274	<?php
                    
373
                    
374	<p><?php _e( 'If you&#8217;re not going to use a great site domain, leave it for a new user. Now have at it!' ); ?></p>
                    
375	<form id="setupform" method="post" action="wp-signup.php">
                    
                
date_helper.php git://github.com/ci-bonfire/Bonfire.git | PHP | 742 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP
                    
6 *
                    
88	 *
                    
89	 * This function is identical to PHPs date() function,
                    
90	 * except that it allows date codes to be formatted using
                    
115			'',
                    
116			preg_replace('/([a-z]+?){1}/i', '\\\\\\1', $datestr)
                    
117		);
                    
131	 *
                    
132	 * As of PHP 5.2, the DateTime extension provides constants that
                    
133	 * serve for the exact same purpose and are used with date().
                    
136	 * @deprecated	3.0.0	Use PHP's native date() instead.
                    
137	 * @link	http://www.php.net/manual/en/class.datetime.php#datetime.constants.types
                    
138	 *
                    
                
finder.php git://github.com/phpbb/phpbb.git | PHP | 546 lines
                    
5*
                    
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
                    
7* @license GNU General Public License, version 2 (GPL-2.0)
                    
53	* @param \phpbb\cache\service $cache A cache instance or null
                    
54	* @param string $php_ext php file extension
                    
55	* @param string $cache_name The name of the cache variable, defaults to
                    
57	*/
                    
58	public function __construct($phpbb_root_path = '', \phpbb\cache\service $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
                    
59	{
                    
132	* There is no default file extension, so to find PHP files only, you will
                    
133	* have to specify .php as a suffix. However when using get_classes, the .php
                    
134	* file extension is automatically added to suffixes.
                    
148	* There is no default file extension, so to find PHP files only, you will
                    
149	* have to specify .php as a suffix. However when using get_classes, the .php
                    
150	* file extension is automatically added to suffixes.
                    
                
Markdown.php git://github.com/vanillaforums/Garden.git | PHP | 3169 lines
                    
1<?php
                    
2
                    
8#
                    
9#           Please see /library/core/class.markdownvanilla.php
                    
10#
                    
15#
                    
16# PHP Markdown
                    
17# Copyright (c) 2004-2014 Michel Fortin
                    
17# Copyright (c) 2004-2014 Michel Fortin
                    
18# <http://michelf.com/projects/php-markdown/>
                    
19#
                    
79	# Regex to match balanced [brackets].
                    
80	# Needed to insert a maximum bracked depth while converting to PHP.
                    
81	protected $nested_brackets_depth = 6;
                    
156		# Remove UTF-8 BOM and marker character in input, if present.
                    
157		$text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text);
                    
158
                    
                
FilterHtml.php git://github.com/drupal/drupal.git | PHP | 471 lines
                    
1<?php
                    
2
                    
74      // is disabled, remove them.
                    
75      $configuration['settings']['allowed_html'] = preg_replace('/\s+/', ' ', $configuration['settings']['allowed_html']);
                    
76    }
                    
                
class.emailtemplate.php git://github.com/vanillaforums/Garden.git | PHP | 559 lines
                    
1<?php
                    
2/**
                    
162        if ($convertNewlines) {
                    
163            $str = preg_replace('/(\015\012)|(\015)|(\012)/', '<br>', $str);
                    
164        }
                    
                
 

Source

Language