PageRenderTime 359ms queryTime 77ms sortTime 36ms getByIdsTime 39ms findMatchingLines 74ms

100+ results results for 'php preg_replace repo:zpartakov/pmCake' (359 ms)

Not the results you expected?
FileSystem.php https://gitlab.com/x33n/ImpressPages | PHP | 213 lines
                    
1<?php
                    
2/**
                    
202    {
                    
203        return preg_replace('{/$}', '', $path);
                    
204    }
                    
                
filters.php https://gitlab.com/Blueprint-Marketing/interoccupy.net | PHP | 176 lines
                    
1<?php
                    
2/**
                    
103	foreach ($wpcf7 as $key => $val) {
                    
104		$val = preg_replace('/' . preg_quote($site_url, '/') . '/i', $new_site_url, $val);
                    
105		$val = preg_replace('/' . preg_quote($admin_email, '/') . '/i', $new_admin_email, $val);
                    
                
datalib_test.php https://bitbucket.org/kudutest/moodlegit.git | PHP | 161 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
17/**
                    
18 * This file contains tests for some of the code in ../datalib.php.
                    
19 *
                    
29global $CFG;
                    
30require_once(dirname(__FILE__) . '/../lib.php');
                    
31
                    
33/**
                    
34 * Unit tests for some of the code in ../datalib.php.
                    
35 *
                    
48        }
                    
49        $newsql = preg_replace('/(?<!:):[a-z][a-z0-9_]*/', '?', $sql);
                    
50        return array($newsql, $newparams);
                    
                
Tokenizer.php https://github.com/nattaphat/hgis.git | PHP | 201 lines
                    
1<?php
                    
2
                    
42        $pos = 0;
                    
43        $s = preg_replace('#/\*.*?\*/#s', '', $s);
                    
44
                    
156    {
                    
157        return preg_replace_callback('#(\\\\(?:[A-Fa-f0-9]{1,6}(?:\r\n|\s)?|[^A-Fa-f0-9]))#', function ($matches) use ($literal) {
                    
158            if ($matches[0][0] == '\\' && strlen($matches[0]) > 1) {
                    
                
Relationship.php https://bitbucket.org/d1rk/lithium.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);
                    
                
account.php https://gitlab.com/ji5656/test2 | PHP | 188 lines
                    
1<?php
                    
2 $page = "My Account";
                    
2 $page = "My Account";
                    
3 include '../includes/connect.php';
                    
4 include '../includes/header.php';
                    
4 include '../includes/header.php';
                    
5 include '../includes/nav.php';
                    
6 include "../includes/loginmembercheck.php";
                    
8<div class="login">
                    
9<?php
                    
10 $memberID = $_SESSION['user'];
                    
17
                    
18<?php
                    
19
                    
40
                    
41<form action="accountprocessing.php" method="post">
                    
42
                    
                
docleanup.php https://github.com/Bigjoos/U-232-V1.git | PHP | 173 lines
                    
1<?php
                    
2/**
                    
24
                    
25require_once(INCL_DIR.'user_functions.php');
                    
26require_once(INCL_DIR.'html_functions.php');
                    
29/** new way **/
                    
30require_once(INCL_DIR.'class_check.php');
                    
31class_check(UC_SYSOP, true, true);
                    
32//if (!min_class(UC_SYSOP)) // or just simply: if (!min_class(UC_STAFF))
                    
33//header( "Location: {$TBDEV['baseurl']}/index.php");
                    
34
                    
50    {
                    
51        if (substr(PHP_OS, 0, 3) == 'WIN') {
                    
52            if (substr(PHP_OS, 0, 3) == 'WIN') {
                    
55
                    
56                return preg_replace('/[\D]/', '', $output[5]) * 1024;
                    
57            }
                    
                
qubaid_condition_test.php https://github.com/pauln/moodle.git | PHP | 161 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
17/**
                    
18 * This file contains tests for some of the code in ../datalib.php.
                    
19 *
                    
29global $CFG;
                    
30require_once(dirname(__FILE__) . '/../lib.php');
                    
31
                    
48        }
                    
49        $newsql = preg_replace('/(?<!:):[a-z][a-z0-9_]*/', '?', $sql);
                    
50        return array($newsql, $newparams);
                    
                
TemplateTask.php https://bitbucket.org/vishallogiciel/admin-bootstrap.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
                    
                
TemplateTask.php https://bitbucket.org/reyx/p0001festivalcachorroquente.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       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
18 */
                    
72		$separator = DS === '/' ? '/' : '\\\\';
                    
73		$core = preg_replace('#shells' . $separator . '$#', '', $core);
                    
74
                    
                
IPv6.php https://github.com/ushahidi/Sweeper.git | PHP | 258 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * A PHP-Based RSS and Atom Feed Framework.
                    
6 * Takes the hard work out of managing a complete RSS/Atom solution.
                    
41 * @link http://simplepie.org/ SimplePie
                    
42 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
                    
43 * @todo phpDoc comments
                    
50 * @package SimplePie
                    
51 * @copyright 2003-2005 The PHP Group
                    
52 * @license http://www.opensource.org/licenses/bsd-license.php
                    
52 * @license http://www.opensource.org/licenses/bsd-license.php
                    
53 * @link http://pear.php.net/package/Net_IPv6
                    
54 * @author Alexander Merz <alexander.merz@web.de>
                    
219				$dec = hexdec($ipv6[$i]);
                    
220				$hex = strtoupper(preg_replace('/^[0]{1,3}(.*[0-9a-fA-F])$/', '\\1', $ipv6[$i]));
                    
221				if ($ipv6[$i] >= 0 && $dec <= 65535 && $hex === strtoupper(dechex($dec)))
                    
                
wp-cache-config.php https://github.com/AJenbo/ubuntudanmark.dk.git | PHP | 127 lines
                    
1<?php
                    
2/*
                    
4
                    
5See wp-cache.php for author details.
                    
6*/
                    
51	} else {
                    
52		$request_uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '..', '', $_SERVER['REQUEST_URI'] ) );
                    
53		if( strpos( $request_uri, '/', 1 ) ) {
                    
67// Array of files that have 'wp-' but should still be cached
                    
68$cache_acceptable_files = array( 'wp-comments-popup.php', 'wp-links-opml.php', 'wp-locations.php' );
                    
69
                    
69
                    
70$cache_rejected_uri = array ( 0 => 'wp-.*\\.php', 1 => 'index\\.php', 2 => 'forum', ); //Added by WP-Cache Manager
                    
71$cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider', 5 => 'Yandex' );
                    
                
QueryBuilder.php https://gitlab.com/Sang240892/ecommerce | 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);
                    
                
Comment.php https://github.com/lenix/silverstripe-comments.git | PHP | 247 lines
                    
1<?php
                    
2
                    
213		$replace = '<a rel="nofollow" href="$1$2">$1$2</a>';
                    
214		return preg_replace($pattern, $replace, $this->Comment);
                    
215	}
                    
                
Filesystem.php https://gitlab.com/jatasya/Slim_framework | PHP | 239 lines
                    
1<?php
                    
2
                    
214    {
                    
215        return preg_replace('#/{2,}#', '/', strtr((string) $name, '\\', '/'));
                    
216    }
                    
                
admin_ratings.php https://github.com/tbleher/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);
                    
                
IndexController.php https://bitbucket.org/dnejedly/eaparts.git | PHP | 167 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
                    
23 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
                    
24 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
                    
25 */
                    
103    {
                    
104        return explode("\n", preg_replace("/(\'(.*?)\')|(\s+)/i", "$1\n", $tagNamesInString));
                    
105    }
                    
                
StringEscape.php https://gitlab.com/cpteam/core | PHP | 231 lines
                    
1<?php
                    
2
                    
84	{
                    
85		return preg_replace("/^(\s*(\r\n|\n|\r)){2,}/m", "\n", $text);
                    
86	}
                    
141
                    
142		$url = preg_replace('/^\b((?!(?:https?|ftp):\/\/)(www\.))/im', 'http://www.', $url);
                    
143
                    
143
                    
144		return preg_replace($reg_exUrl, '<i><a href="$0" target="_blank" rel="nofollow">$0</a></i>', $url);
                    
145	}
                    
148	{
                    
149		$text = preg_replace("/\*+(.*)?/i", "<ul><li>$1</li></ul>", $text);
                    
150		$text = preg_replace("/(\<\/ul\>\n(.*)\<ul\>*)+/", "", $text);
                    
159		$data = strtolower($data);
                    
160		$data = preg_replace("/[^[:alpha:][:digit:]]/", "-", $data);
                    
161		$data = trim($data, "-");
                    
                
Query.php https://github.com/tmccormi/openemr.git | PHP | 195 lines
                    
1<?php
                    
2/**
                    
52
                    
53        if ($xpathPhpfunctions = $document->getXpathPhpFunctions()) {
                    
54            $xpath->registerNamespace('php', 'http://php.net/xpath');
                    
55            if ($xpathPhpfunctions === true) {
                    
56                $xpath->registerPhpFunctions();
                    
57            } else {
                    
57            } else {
                    
58                $xpath->registerPhpFunctions($xpathPhpfunctions);
                    
59            }
                    
93        // Arbitrary attribute value contains whitespace
                    
94        $path = preg_replace_callback(
                    
95            '/\[\S+?([\'"])((?!\1|\\\1).*?)\1\]/',
                    
96            function ($matches) use ($placeholder) {
                    
97                return str_replace($matches[2], preg_replace('/\s+/', $placeholder, $matches[2]), $matches[0]);
                    
98            },
                    
                
ArticleHTMLGalley.inc.php https://github.com/mcrider/pkpUpgradeTestSuite.git | PHP | 259 lines
                    
1<?php
                    
2
                    
3/**
                    
4 * @file classes/article/ArticleHTMLGalley.inc.php
                    
5 *
                    
14
                    
15// $Id: ArticleHTMLGalley.inc.php,v 1.33 2009/05/12 16:57:20 asmecher Exp $
                    
16
                    
55
                    
56			$contents = preg_replace(
                    
57				'/([Ss][Rr][Cc]|[Hh][Rr][Ee][Ff]|[Dd][Aa][Tt][Aa])\s*=\s*"([^"]*' . $pattern . ')"/',
                    
62			// Replacement for Flowplayer
                    
63			$contents = preg_replace(
                    
64				'/[Uu][Rr][Ll]\s*\:\s*\'(' . $pattern . ')\'/',
                    
69			// Replacement for other players (ested with odeo; yahoo and google player won't work w/ OJS URLs, might work for others)
                    
70			$contents = preg_replace(
                    
71				'/[Uu][Rr][Ll]=([^"]*' . $pattern . ')/',
                    
                
main.php https://github.com/dgz/shimmie2.git | PHP | 155 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].+)!', '<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);
                    
                
docleanup.php https://github.com/cybernet/CyBerFuN-CoDeX.git | PHP | 154 lines
                    
1<?php
                    
2require_once("include/bittorrent.php");
                    
3require_once "include/user_functions.php";
                    
9    // moddifed logginorreturn by retro//Remember to change the following line to match your server
                    
10    print("<html><h1>Not Found</h1><p>The requested URL /{$_SERVER['PHP_SELF']} was not found on this server.</p><hr /><address>Apache/1.1.11 ".$SITENAME." Server at " . $_SERVER['SERVER_NAME'] . " Port 80</address></body></html>\n");
                    
11    die();
                    
31        // Doesn't work for 2000
                    
32        // If you need it to work for 2000 look at http://us2.php.net/manual/en/function.memo...usage.php#54642
                    
33        if (substr(PHP_OS, 0, 3) == 'WIN') {
                    
37
                    
38                return preg_replace('/[\D]/', '', $output[5]) * 1024;
                    
39            }
                    
56
                    
57?><tr><td class="colhead">Cleanup Name</td><td class="colhead">Last Run</td><td class="colhead">Runs every</td><td class="colhead">Scheduled to run</td></tr><?php
                    
58$res = mysql_query("SELECT arg, value_u FROM avps");
                    
                
XLSX.php https://gitlab.com/VTTE/sitios-vtte | PHP | 178 lines
                    
1<?php
                    
2
                    
105    /**
                    
106     * Converts PHP control characters from the given string to OpenXML escaped control characters
                    
107     *
                    
126
                    
127        return preg_replace_callback("/({$this->escapableControlCharactersPattern})/", function($matches) {
                    
128            return $this->controlCharactersEscapingReverseMap[$matches[0]];
                    
139    {
                    
140        return preg_replace('/_(x[\dA-F]{4})_/', '_x005F_$1_', $string);
                    
141    }
                    
143    /**
                    
144     * Converts OpenXML escaped control characters from the given string to PHP control characters
                    
145     *
                    
161            // only unescape characters that don't contain the escaped escape character for now
                    
162            $unescapedString = preg_replace("/(?<!_x005F)($escapedCharValue)/", $charValue, $unescapedString);
                    
163        }
                    
                
date_helper.php https://bitbucket.org/mbaily/tremain.git | PHP | 616 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 5.2.4 or newer
                    
6 *
                    
68 *
                    
69 * This function is identical to PHPs date() function,
                    
70 * except that it allows date codes to be formatted using
                    
92
                    
93		$datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr));
                    
94		return date($datestr, $time);
                    
447		$datestr = trim($datestr);
                    
448		$datestr = preg_replace("/\040+/", ' ', $datestr);
                    
449
                    
614
                    
615/* End of file date_helper.php */
                    
616/* Location: ./system/helpers/date_helper.php */
                    
                
readmes.inc.php https://gitlab.com/Gashler/sg | PHP | 233 lines
                    
77												$rm = preg_replace ("/(\=\=)( )(Description)( )(\=\=)/", "<h4 id=\"rm-description\">$3</h4>", $rm);
                    
78												$rm = preg_replace ("/(\=\=)( )(Screenshots)( )(\=\=)/", "<h4 id=\"rm-screenshots\">$3</h4>", $rm);
                    
79												$rm = preg_replace ("/(\=\=)( )(Frequently Asked Questions)( )(\=\=)/", "<h4 id=\"rm-faqs\">$3</h4>", $rm);
                    
101														{
                    
102															$rm = preg_replace ("/\<pre\>\<code\>/i", '<pre lang="php" escaped="true">', $rm);
                    
103															$rm = preg_replace ("/\<\/code\>\<\/pre\>/i", '</pre>', $rm);
                    
119										$rm = preg_replace ("/(\=\=)( )(Installation)( )(\=\=)/", "<h2 id=\"rm-installation\">$3</h2>", $rm);
                    
120										$rm = preg_replace ("/(\=\=)( )(Description)( )(\=\=)/", "<h2 id=\"rm-description\">$3</h2>", $rm);
                    
121										$rm = preg_replace ("/(\=\=)( )(Screenshots)( )(\=\=)/", "<h2 id=\"rm-screenshots\">$3</h2>", $rm);
                    
121										$rm = preg_replace ("/(\=\=)( )(Screenshots)( )(\=\=)/", "<h2 id=\"rm-screenshots\">$3</h2>", $rm);
                    
122										$rm = preg_replace ("/(\=\=)( )(Frequently Asked Questions)( )(\=\=)/", "<h2 id=\"rm-faqs\">$3</h2>", $rm);
                    
123										$rm = preg_replace ("/(\=\=)( )(Changelog)( )(\=\=)/", "<h2 id=\"rm-changelog\">$3</h2>", $rm);
                    
153												{
                    
154													$rm = preg_replace ("/\<pre\>\<code\>/i", '<pre lang="php" escaped="true">', $rm);
                    
155													$rm = preg_replace ("/\<\/code\>\<\/pre\>/i", '</pre>', $rm);
                    
                
Ftp.php https://bitbucket.org/ajalovec/gaufrette.git | PHP | 474 lines
                    
1<?php
                    
2
                    
55
                    
56        $temp = fopen('php://temp', 'r+');
                    
57
                    
80
                    
81        $temp = fopen('php://temp', 'r+');
                    
82        $size = fwrite($temp, $content);
                    
186
                    
187        $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory);
                    
188
                    
                
cusm_discussion_answer.php https://gitlab.com/ptisky/API_prestashop | PHP | 458 lines
                    
1<?php

                    
2/**

                    
62		

                    
63		$message_infos['message'] = preg_replace(

                    
64				'/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui',

                    
379</style>

                    
380<script type="text/javascript" src="<?php echo SC_JQUERY;?>"></script>

                    
381<script type="text/javascript">

                    
381<script type="text/javascript">

                    
382<?php if($success) { ?>

                    
383parent.successAnswer();

                    
383parent.successAnswer();

                    
384<?php } ?>

                    
385

                    
403	

                    
404		<?php 

                    
405		if(!empty($errors)) 

                    
                
setup-config.php https://gitlab.com/phamngsinh/baitaplon_sinhvien | PHP | 347 lines
                    
52if ( file_exists( ABSPATH . 'wp-config.php' ) )
                    
53	wp_die( '<p>' . sprintf( __( "The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='%s'>installing now</a>." ), 'install.php' ) . '</p>' );
                    
54
                    
56if ( file_exists(ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '../wp-settings.php' ) )
                    
57	wp_die( '<p>' . sprintf( __( "The file 'wp-config.php' 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='install.php'>installing now</a>."), 'install.php' ) . '</p>' );
                    
58
                    
137	<?php _e( 'We&#8217;re going to use this information to create a <code>wp-config.php</code> file.' ); ?>
                    
138	<strong><?php _e( "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 <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>." ); ?></strong>
                    
139	<?php _e( "Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>." ); ?>
                    
307<p><?php _e( 'After you&#8217;ve done that, click &#8220;Run the install.&#8221;' ); ?></p>
                    
308<p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>
                    
309<script>
                    
338
                    
339<p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>
                    
340<?php
                    
                
config.php https://gitlab.com/wildanoo/E-procurement | PHP | 369 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2
                    
18//$config['base_url'] = "http://".$_SERVER['HTTP_HOST'];
                    
19//$config['base_url'] .= preg_replace('@/+$@','',dirname($_SERVER['SCRIPT_NAME'])).'/'; 
                    
20// OR
                    
30|
                    
31| Typically this will be your index.php file, unless you've renamed it to
                    
32| something else. If you are using mod_rewrite to remove the page set this
                    
156| invoke your controllers and its functions:
                    
157| example.com/index.php?c=controller&m=function
                    
158|
                    
180|	0 = Disables logging, Error logging TURNED OFF
                    
181|	1 = Error Messages (including PHP errors)
                    
182|	2 = Debug Messages
                    
207|
                    
208| Each item that is logged has an associated date. You can use PHP date
                    
209| codes to set your own date formatting
                    
                
StylesheetRendererSubscriber.php https://github.com/bit3/contao-theme-plus.git | PHP | 362 lines
                    
1<?php
                    
2
                    
149                        $url  = $property->getValue($realAssets);
                    
150                        $name = 'url_' . basename(parse_url($url, PHP_URL_PATH));
                    
151                    } else {
                    
157                $url = sprintf(
                    
158                    'assets/theme-plus/proxy.php/css/%s/%s',
                    
159                    $id,
                    
196
                    
197                $html .= $linkHtml . PHP_EOL;
                    
198
                    
221                // remove query string
                    
222                $targetPath = preg_replace('~\?\.*~', '', $targetPath);
                    
223                // remove leading /
                    
252
                    
253                $html .= $styleHtml . PHP_EOL;
                    
254
                    
                
auto-download-locales.php https://bitbucket.org/kenaku/karate.git | PHP | 340 lines
                    
1<?php
                    
2
                    
17        
                    
18        $wpversion = preg_replace('#-(.+)$#', '', $wp_version);
                    
19         
                    
38        global $wp_version, $sitepress;
                    
39        $wpversion = preg_replace('#-(.+)$#', '', $wp_version);
                    
40        
                    
105                    $html .= '<td align="right">';
                    
106                    $html .= '<a href="' . admin_url('admin.php?page=' . WPML_ST_FOLDER . '/menu/string-translation.php&amp;download_mo=' . $language . '&amp;version=' . $version) . '" class="button-secondary">' .  __('Review changes and update', 'wpml-string-translation') . '</a>'; 
                    
107                    $html .= '</td>';
                    
147    function load_xml(){
                    
148        if(!class_exists('WP_Http')) include_once ABSPATH . WPINC . '/class-http.php';
                    
149        $client = new WP_Http();
                    
165        
                    
166        $wpversion = preg_replace('#-(.+)$#', '', $wp_version)   ;
                    
167        
                    
                
declarer_bases.php https://bitbucket.org/re_al_/real.test.spip.git | PHP | 231 lines
                    
1<?php
                    
2
                    
63	while ($f = readdir($d)) {
                    
64		if ((preg_match('/^(.*)[.]php$/', $f, $s))
                    
65			and is_readable($f = $dir . $f)
                    
147		define('_DECLARER_PASS_DB', $pass_db);
                    
148		// si on est sur le meme serveur que connect.php
                    
149		// indiquer quelle est la db utilisee pour l'exclure des choix possibles
                    
188		// securite : le nom doit etre un mot sans caracteres speciaux
                    
189		$f = preg_replace(',[^\w],', '', $nom_connect);
                    
190		if ($f !== $nom_connect) {
                    
191			$erreurs['nom_connect'] = _T('erreur_nom_connect_incorrect');
                    
192		} elseif (file_exists(_DIR_CONNECT . $nom_connect . '.php')) {
                    
193			$erreurs['nom_connect'] = _T('erreur_connect_deja_existant');
                    
225
                    
226	install_fichier_connexion(_DIR_CONNECT . _DECLARER_NOM_CONNECT . '.php', $conn);
                    
227
                    
                
waldo.php https://bitbucket.org/driftcreate/supermarketetc.git | PHP | 167 lines
                    
1<?php
                    
2    /**
                    
3     * A Dynamic Responsive CSS Background Images Extension for WordPress
                    
4     * and Other PHP-Based Applications
                    
5     *
                    
5     *
                    
6     * Adds support to WordPress themes and other PHP based applications
                    
7     * (with appropriate modifications) to dynamically generate styles
                    
20     * Thank you to Donald Allen <https://github.com/donaldallen> for presenting the
                    
21     * initial idea of PHP generated styles for use with background images.
                    
22     */
                    
60        public function waldoSavedStyles() {
                    
61            return unserialize(file_get_contents($this->template_dir .'/waldo-styles.php'));
                    
62        }
                    
96         * waldoStyles
                    
97         * Minify and write styles to waldo.css, save waldo_styles array to waldo-styles.php.
                    
98         *
                    
                
feeds.php https://github.com/agnesrambaud/yacs.git | PHP | 428 lines
                    
1<?php
                    
2/**
                    
131		// get them from the database
                    
132		include_once $context['path_to_root'].'links/links.php';
                    
133		return Links::list_news(0, $count, $variant);
                    
140	 * To troubleshoot feeders you can configure the debugging facility in the
                    
141	 * configuration panel for feeds (parameter [code]debug_feeds[/code], at [script]feeds/configure.php[/script]).
                    
142	 *
                    
142	 *
                    
143	 * @see links/link.php
                    
144	 *
                    
230		case 'files':
                    
231			return 'files/feed.php';
                    
232		case 'opml':
                    
267	 * At the end of the feeding process, the database is purged from oldest links according to the limit
                    
268	 * defined in parameters/feeds.include.php, set through feeds/configure.php.
                    
269	 * See Links::purge_old_news().
                    
                
wpseo-functions.php https://bitbucket.org/geniusdivision/genius-division-wordpress-theme.git | PHP | 388 lines
                    
1<?php
                    
2/**
                    
84	if ( strpos( $string, '%%' ) === false )
                    
85		return trim( preg_replace( '/\s+/u', ' ', $string ) );
                    
86
                    
107	if ( strpos( $string, '%%' ) === false )
                    
108		return trim( preg_replace( '/\s+/u', ' ', $string ) );
                    
109
                    
205	if ( strpos( $string, '%%' ) === false ) {
                    
206		$string = preg_replace( '/\s+/u', ' ', $string );
                    
207		return trim( $string );
                    
246
                    
247	$string = preg_replace( '/\s+/u', ' ', $string );
                    
248	return trim( $string );
                    
316function wpseo_strip_shortcode( $text ) {
                    
317	return preg_replace( '|\[[^\]]+\]|s', '', $text );
                    
318}
                    
                
helper.php https://github.com/LouisLandry/joomla-platform.git | PHP | 518 lines
                    
1<?php
                    
2/**
                    
157		// Get module path
                    
158		$module->module = preg_replace('/[^A-Z0-9_\.-]/i', '', $module->module);
                    
159		$path = JPATH_BASE . '/modules/' . $module->module . '/' . $module->module . '.php';
                    
184
                    
185		include_once JPATH_THEMES . '/system/html/modules.php';
                    
186		$chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/modules.php';
                    
261		// Build the template and base path for the layout
                    
262		$tPath = JPATH_THEMES . '/' . $template . '/html/' . $module . '/' . $layout . '.php';
                    
263		$bPath = JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php';
                    
263		$bPath = JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php';
                    
264		$dPath = JPATH_BASE . '/modules/' . $module . '/tmpl/default.php';
                    
265
                    
                
class.HP-UX.inc.php https://github.com/vtiger-jp/vtigercrm-5.1.x-ja.git | PHP | 421 lines
                    
1<?php 
                    
2
                    
2
                    
3// phpSysInfo - A PHP System Information Script
                    
4// http://phpsysinfo.sourceforge.net/
                    
19
                    
20// $Id: class.HP-UX.inc.php,v 1.17 2006/02/11 17:31:03 bigmichi1 Exp $
                    
21
                    
170          if (!preg_match('/bridge/i', $key) && !preg_match('/USB/i', $key)) {
                    
171            $results[] = preg_replace('/\([^\)]+\)\.$/', '', trim($value));
                    
172          } 
                    
                
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
                    
                
functions.php https://github.com/eyezm/ZoneMinder.git | PHP | 455 lines
                    
1<?php
                    
2/* 
                    
2/* 
                    
3 * functions.php is created by Jai Dhar, FPS-Tech, for use with eyeZm
                    
4 * iPhone application. This is not intended for use with any other applications,
                    
9 */
                    
10/* These functions are taken from functions.php */
                    
11function validInteger( $input )
                    
12{
                    
13    return( preg_replace( '/\D/', '', $input ) );
                    
14}
                    
135</head>
                    
136<?php
                    
137}
                    
191}
                    
192/* Returns with PHP-GD exists */
                    
193function gdExists()
                    
                
Item.php https://bitbucket.org/acidel/buykoala.git | PHP | 447 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

                    
23 * @copyright   Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)

                    
24 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)

                    
25 */

                    
256        return Mage::helper('core/string')

                    
257            ->substr(preg_replace('/[\pC¢€•—™°½]|shipping/ui', '', $string), 0, 3500);

                    
258    }

                    
428    {

                    
429        return preg_replace('/\s+/', '_', $string);

                    
430

                    
430

                    
431//        $string = preg_replace('/([^a-z^0-9^_])+/','_',strtolower($string));

                    
432//        $string = preg_replace('/_{2,}/','_',$string);

                    
                
class-ai1ec-database.php https://gitlab.com/Blueprint-Marketing/interoccupy.net | PHP | 521 lines
                    
1<?php
                    
2//
                    
2//
                    
3//  class-ai1ec-database.php
                    
4//  all-in-one-event-calendar
                    
60			require_once ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR .
                    
61				'includes' . DIRECTORY_SEPARATOR . 'upgrade.php';
                    
62		}
                    
100					'indexes' => array(),
                    
101					'content' => preg_replace( '#`#', '', $matches[2] ),
                    
102					'clauses' => $matches[3],
                    
142				++$lineno;
                    
143				$line = trim( preg_replace( '#\s+#', ' ', $line ) );
                    
144				$line_new = rtrim( $line, ',' );
                    
187	protected function _parse_index( $description ) {
                    
188		$description = preg_replace(
                    
189			'#^CONSTRAINT(\s+`?[^ ]+`?)?\s+#six',
                    
                
display.php https://gitlab.com/potion/librechan | PHP | 528 lines
                    
1<?php
                    
2
                    
13	joaoptm78@gmail.com
                    
14	http://www.php.net/manual/en/function.filesize.php#100097
                    
15*/
                    
41	}
                    
42	$body = preg_replace('/\/$/', '', $body);
                    
43	
                    
159	// Replace line breaks with some whitespace
                    
160	$body = preg_replace('@<br/?>@i', '  ', $body);
                    
161	
                    
210	// It's easiest just to remove them all first.
                    
211	$body = preg_replace('/<!--.*?-->/s', '', $body);
                    
212	
                    
226		// Remove any corrupt tags at the end
                    
227		$body = preg_replace('/<([\w]+)?([^>]*)?$/', '', $body);
                    
228		
                    
                
Converter.php https://gitlab.com/luisrepo/ClienteWS | PHP | 396 lines
                    
1<?php
                    
2/**
                    
18 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
19 * @version    $Id: Converter.php 23775 2011-03-01 17:25:24Z ralph $
                    
20 */
                    
38     *
                    
39     * @see Net_LDAP2_Util::asc2hex32() from Benedikt Hallinger <beni@php.net>
                    
40     * @link http://pear.php.net/package/Net_LDAP2
                    
40     * @link http://pear.php.net/package/Net_LDAP2
                    
41     * @author Benedikt Hallinger <beni@php.net>
                    
42     *
                    
61     *
                    
62     * @see Net_LDAP2_Util::hex2asc() from Benedikt Hallinger <beni@php.net>,
                    
63     * heavily based on work from DavidSmith@byu.net
                    
63     * heavily based on work from DavidSmith@byu.net
                    
64     * @link http://pear.php.net/package/Net_LDAP2
                    
65     * @author Benedikt Hallinger <beni@php.net>, heavily based on work from DavidSmith@byu.net
                    
                
date.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 462 lines
                    
1<?php
                    
2/**
                    
252	 *
                    
253	 * @param   string   $format     The date format specification string (see {@link PHP_MANUAL#date})
                    
254	 * @param   boolean  $local      True to return the date string in the local time zone, false to return it in GMT.
                    
268	 *
                    
269	 * @param   string   $format     The date format specification string (see {@link PHP_MANUAL#date})
                    
270	 * @param   boolean  $local      True to return the date string in the local time zone, false to return it in GMT.
                    
281			// Do string replacements for date format options that can be translated.
                    
282			$format = preg_replace('/(^|[^\\\])D/', "\\1" . self::DAY_ABBR, $format);
                    
283			$format = preg_replace('/(^|[^\\\])l/', "\\1" . self::DAY_NAME, $format);
                    
283			$format = preg_replace('/(^|[^\\\])l/', "\\1" . self::DAY_NAME, $format);
                    
284			$format = preg_replace('/(^|[^\\\])M/', "\\1" . self::MONTH_ABBR, $format);
                    
285			$format = preg_replace('/(^|[^\\\])F/', "\\1" . self::MONTH_NAME, $format);
                    
                
polldaddy.php https://github.com/sharpmachine/wakeupmedia.com.git | PHP | 398 lines
                    
1<?php
                    
2
                    
94			$item_id   = wp_strip_all_tags( $item_id );
                    
95			$item_id   = preg_replace( '/[^_a-z0-9]/i', '', $item_id );
                    
96			
                    
226				
                    
227				$survey      = preg_replace( '/[^a-f0-9]/i', '', $survey );
                    
228				$survey_url  = esc_url( "http://polldaddy.com/s/{$survey}" );			
                    
275				else {				
                    
276					$text_color = preg_replace( '/[^a-f0-9]/i', '', $text_color );
                    
277					$back_color = preg_replace( '/[^a-f0-9]/i', '', $back_color );
                    
388	function polldaddy_link( $content ) {
                    
389		return preg_replace( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n<script type='text/javascript' language='javascript' charset='utf-8' src='http://static.polldaddy.com/p/$1.js'></script><noscript> <a href='http://polldaddy.com/poll/$1/'>View Poll</a></noscript>\n", $content );
                    
390	}
                    
                
Mysql.php https://github.com/grjones/qframe.git | PHP | 331 lines
                    
1<?php
                    
2/**
                    
39  private static function expandNumericString($string) {
                    
40    $string = preg_replace('/K$/', '000', $string);
                    
41    $string = preg_replace('/M$/', '000000', $string);
                    
41    $string = preg_replace('/M$/', '000000', $string);
                    
42    $string = preg_replace('/G$/', '000000000', $string);
                    
43    if(!is_numeric($string)) throw new Exception("Invalid number string [{$string}]");
                    
                
session.php https://gitlab.com/alexprowars/bitrix | PHP | 317 lines
                    
1<?php
                    
2
                    
161					case "USER_AGENT":
                    
162						$val = preg_replace("/[\n\r]+/", " ", $val);
                    
163						$match = ($arFilter[$key."_EXACT_MATCH"]=="Y" && $match_value_set) ? "N" : "Y";
                    
258				S.LAST_HIT_ID,
                    
259				S.PHPSESSID,
                    
260				S.ADV_ID,
                    
                
Calendar.php https://bitbucket.org/mbaily/tremain.git | PHP | 475 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 5.2.4 or newer
                    
6 *
                    
49
                    
50		if ( ! in_array('calendar_lang.php', $this->CI->lang->is_loaded, TRUE))
                    
51		{
                    
160			// Add a trailing slash to the  URL if needed
                    
161			$this->next_prev_url = preg_replace("/(.+?)\/*$/", "\\1/",  $this->next_prev_url);
                    
162
                    
473
                    
474/* End of file Calendar.php */
                    
475/* Location: ./system/libraries/Calendar.php */
                    
                
SearchUpdate.php https://gitlab.com/coco-codeselfstudy/mediawiki-core | PHP | 204 lines
                    
1<?php
                    
2/**
                    
124
                    
125		$text = preg_replace( "/<\\/?\\s*[A-Za-z][^>]*?>/",
                    
126			' ', $wgContLang->lc( " " . $text . " " ) ); # Strip HTML markup
                    
126			' ', $wgContLang->lc( " " . $text . " " ) ); # Strip HTML markup
                    
127		$text = preg_replace( "/(^|\\n)==\\s*([^\\n]+)\\s*==(\\s)/sD",
                    
128			"\\1\\2 \\2 \\2\\3", $text ); # Emphasize headings
                    
133		$pat = "/(^|[^\\[])({$protos}):[{$uc}]+([^{$uc}]|$)/";
                    
134		$text = preg_replace( $pat, "\\1 \\3", $text );
                    
135
                    
137		$p2 = "/([^\\[])\\[({$protos}):[{$uc}]+\\s+([^\\]]+)]/";
                    
138		$text = preg_replace( $p1, "\\1 ", $text );
                    
139		$text = preg_replace( $p2, "\\1 \\3 ", $text );
                    
142		$pat2 = "/\\[\\[image:([{$uc}]+)\\.(gif|png|jpg|jpeg)([^{$uc}])/i";
                    
143		$text = preg_replace( $pat2, " \\1 \\3", $text );
                    
144
                    
                
locale.php https://github.com/mhoofman/wordpress-heroku.git | PHP | 373 lines
                    
1<?php
                    
2/**
                    
122		foreach ($this->weekday_initial as $weekday_ => $weekday_initial_) {
                    
123			$this->weekday_initial[$weekday_] = preg_replace('/_.+_initial$/', '', $weekday_initial_);
                    
124		}
                    
164		foreach ($this->month_abbrev as $month_ => $month_abbrev_) {
                    
165			$this->month_abbrev[$month_] = preg_replace('/_.+_abbreviation$/', '', $month_abbrev_);
                    
166		}
                    
174		// Numbers formatting
                    
175		// See http://php.net/number_format
                    
176
                    
176
                    
177		/* translators: $thousands_sep argument for http://php.net/number_format, default is , */
                    
178		$trans = __('number_format_thousands_sep');
                    
180
                    
181		/* translators: $dec_point argument for http://php.net/number_format, default is . */
                    
182		$trans = __('number_format_decimal_point');
                    
                
class-wc-download-handler.php https://gitlab.com/luyxtran264/myproject | PHP | 426 lines
                    
1<?php
                    
2
                    
41			'email'       => sanitize_email( str_replace( ' ', '+', $_GET['email'] ) ),
                    
42			'download_id' => wc_clean( isset( $_GET['key'] ) ? preg_replace( '/\s+/', ' ', $_GET['key'] ) : '' )
                    
43		) );
                    
258			self::download_headers( $parsed_file_path['file_path'], $filename );
                    
259			$xsendfile_path = trim( preg_replace( '`^' . str_replace( '\\', '/', getcwd() ) . '`', '', $parsed_file_path['file_path'] ), '/' );
                    
260			header( "X-Accel-Redirect: /$xsendfile_path" );
                    
338		}
                    
339		if ( function_exists( 'get_magic_quotes_runtime' ) && get_magic_quotes_runtime() && version_compare( phpversion(), '5.4', '<' ) ) {
                    
340			set_magic_quotes_runtime( 0 );
                    
369	 *
                    
370	 * Reads file in chunks so big downloads are possible without changing PHP.INI - http://codeigniter.com/wiki/Download_helper_for_large_files/.
                    
371	 *
                    
                
DataSource.php https://bitbucket.org/vishallogiciel/admin-bootstrap.git | PHP | 445 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 * @package       Cake.Model.Datasource
                    
16 * @package       Cake.Model.Datasource
                    
17 * @since         CakePHP(tm) v 0.10.5.1790
                    
18 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
                    
25 *
                    
26 * @link          http://book.cakephp.org/2.0/en/models/datasources.html#basic-api-for-datasources
                    
27 * @package       Cake.Model.Datasource
                    
                
ExtractStyleBlocks.php https://gitlab.com/zenfork/vektor | 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;
                    
                
collect.php https://gitlab.com/alexprowars/bitrix | PHP | 493 lines
                    
1<?php
                    
2namespace Bitrix\Translate\Controller\Asset;
                    
175			$assemblyDate = $this->controller->getRequest()->get('assemblyDate');
                    
176			if ($assemblyDate !== null && preg_replace("/[\D]+/", "", $assemblyDate) && mb_strlen($assemblyDate) == 8)
                    
177			{
                    
417
                    
418				if ((mb_substr($name, -4) === '.php') && is_file($fullPath))
                    
419				{
                    
                
helper.php https://github.com/dg482/joomla-platform.git | PHP | 523 lines
                    
1<?php
                    
2/**
                    
160		// Get module path
                    
161		$module->module = preg_replace('/[^A-Z0-9_\.-]/i', '', $module->module);
                    
162		$path = JPATH_BASE . '/modules/' . $module->module . '/' . $module->module . '.php';
                    
187
                    
188		include_once JPATH_THEMES . '/system/html/modules.php';
                    
189		$chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/modules.php';
                    
264		// Build the template and base path for the layout
                    
265		$tPath = JPATH_THEMES . '/' . $template . '/html/' . $module . '/' . $layout . '.php';
                    
266		$bPath = JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php';
                    
                
Document.php https://bitbucket.org/GIBravo/materialdesign.git | PHP | 246 lines
                    
1<?php
                    
2
                    
183        $jsCode = str_replace("\t", "", $jsCode);
                    
184        $jsCode = preg_replace('/\s\s+/', ' ', $jsCode);
                    
185
                    
202        $style = str_replace("\t", "", $style);
                    
203        $style = preg_replace('/\s\s+/', ' ', $style);
                    
204        
                    
                
ReplaceTokens.php https://gitlab.com/Isaki/le331.fr | PHP | 475 lines
                    
1<?php
                    
2
                    
22
                    
23include_once 'phing/filters/BaseParamFilterReader.php';
                    
24include_once 'phing/types/TokenSource.php';
                    
24include_once 'phing/types/TokenSource.php';
                    
25include_once 'phing/filters/ChainableReader.php';
                    
26
                    
174        // filter buffer
                    
175        $buffer = preg_replace_callback(
                    
176            "/" . preg_quote($this->_beginToken, '/') . "([\w\.\-:]+?)" . preg_quote($this->_endToken, '/') . "/",
                    
                
file.php https://github.com/dg482/joomla-platform.git | PHP | 554 lines
                    
1<?php
                    
2/**
                    
49	{
                    
50		return preg_replace('#\.[^.]*$#', '', $file);
                    
51	}
                    
65
                    
66		return preg_replace($regex, '', $file);
                    
67	}
                    
430	 *
                    
431	 * @param   string   $src          The name of the php (temporary) uploaded file
                    
432	 * @param   string   $dest         The path (including filename) to move the uploaded file to
                    
                
Item.php https://bitbucket.org/dnejedly/eaparts.git | PHP | 447 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
                    
23 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
                    
24 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
                    
25 */
                    
256        return Mage::helper('core/string')
                    
257            ->substr(preg_replace('/[\pC¢€•—™°½]|shipping/ui', '', $string), 0, 3500);
                    
258    }
                    
428    {
                    
429        return preg_replace('/\s+/', '_', $string);
                    
430
                    
430
                    
431//        $string = preg_replace('/([^a-z^0-9^_])+/','_',strtolower($string));
                    
432//        $string = preg_replace('/_{2,}/','_',$string);
                    
                
custom-background.php https://github.com/toxik/iHazNews.git | PHP | 359 lines
                    
183<tr valign="top">
                    
184<th scope="row"><?php _e('Preview'); ?></th>
                    
185<td>
                    
197?>
                    
198<div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?>
                    
199<?php if ( get_background_image() ) { ?>
                    
201<img class="custom-background-image" src="<?php echo get_theme_mod('background_image_thumb', ''); ?>" style="visibility:hidden;" alt="" />
                    
202<?php } ?>
                    
203</div>
                    
273<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('No Repeat'); ?></option></label>
                    
274	<label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile'); ?></option></label>
                    
275	<label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile Horizontally'); ?></option></label>
                    
275	<label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile Horizontally'); ?></option></label>
                    
276	<label><input type="radio" name="background-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile Vertically'); ?></option></label>
                    
277</fieldset></td>
                    
                
function.encoded.php https://github.com/rinie/TransFormr.git | PHP | 275 lines
                    
1<?php
                    
2defined( '_Transformr' ) or die( 'Restricted access' );
                    
7function html_convert_entities($string) {
                    
8  return preg_replace_callback('/([a-zA-Z][a-zA-Z0-9]+);/', 
                    
9                               'convert_entity', $string);
                    
                
Regex.php https://bitbucket.org/dannyelps/rea.git | PHP | 319 lines
                    
1<?php
                    
2
                    
290
                    
291        $this->pattern = preg_replace_callback('~[\\\\]*\\.~', $replace, $this->pattern);
                    
292
                    
                
text.php https://github.com/robertleeplummerjr/bluebox.git | PHP | 410 lines
                    
1<?php defined('SYSPATH') OR die('No direct access allowed.');
                    
2/**
                    
4 *
                    
5 * $Id: text.php 3769 2008-12-15 00:48:56Z zombor $
                    
6 *
                    
9 * @copyright  (c) 2007-2008 Kohana Team
                    
10 * @license    http://kohanaphp.com/license.html
                    
11 */
                    
173	{
                    
174		return preg_replace('#(?<!:)//+#', '/', $str);
                    
175	}
                    
205			$regex .= 'e';
                    
206			return preg_replace($regex, 'str_repeat($replacement, utf8::strlen(\'$1\'))', $str);
                    
207		}
                    
208
                    
209		return preg_replace($regex, $replacement, $str);
                    
210	}
                    
                
lab_exchange_tools.php https://github.com/md-tech/openemr.git | PHP | 353 lines
                    
1<?php
                    
2// Copyright (C) 2010 OpenEMR Support LLC   
                    
7
                    
8require_once("../globals.php");
                    
9require_once("$srcdir/sql.inc");
                    
9require_once("$srcdir/sql.inc");
                    
10require_once("$srcdir/formdata.inc.php");
                    
11
                    
343{
                    
344        $phone = preg_replace("/[^0-9]/", "", $phone);
                    
345        if(strlen($phone) == 7)
                    
345        if(strlen($phone) == 7)
                    
346                return preg_replace("/([0-9]{3})([0-9]{4})/", "$1-$2", $phone);
                    
347        elseif(strlen($phone) == 10)
                    
347        elseif(strlen($phone) == 10)
                    
348                return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "($1) $2-$3", $phone);
                    
349        else
                    
                
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;
                    
                
Email.php https://github.com/silasrm/MyZendAssets.git | PHP | 431 lines
                    
1<?php
                    
2
                    
249        {
                    
250            if( substr( PHP_VERSION, 0, 3 ) >= 5.3 )
                    
251                return preg_replace_callback( '/{{(\w+)}}/'
                    
256            else
                    
257                return preg_replace_callback( '/{{(\w+)}}/'
                    
258                							, create_function( '$match', 'return &$vars[$match[1]];' )
                    
                
Config.php https://gitlab.com/koutyan777/Genisys | PHP | 503 lines
                    
1<?php
                    
2
                    
100	public static function fixYAMLIndexes($str){
                    
101		return preg_replace("#^([ ]*)([a-zA-Z_]{1}[ ]*)\\:$#m", "$1\"$2\":", $str);
                    
102	}
                    
                
Converter.php https://github.com/tart-summer-camp-2011/Ibrahim-Akpinar.git | PHP | 396 lines
                    
1<?php
                    
2/**
                    
18 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
19 * @version    $Id: Converter.php 23486 2010-12-10 04:05:30Z mjh_ca $
                    
20 */
                    
38     *
                    
39     * @see Net_LDAP2_Util::asc2hex32() from Benedikt Hallinger <beni@php.net>
                    
40     * @link http://pear.php.net/package/Net_LDAP2
                    
40     * @link http://pear.php.net/package/Net_LDAP2
                    
41     * @author Benedikt Hallinger <beni@php.net>
                    
42     *
                    
61     *
                    
62     * @see Net_LDAP2_Util::hex2asc() from Benedikt Hallinger <beni@php.net>,
                    
63     * heavily based on work from DavidSmith@byu.net
                    
63     * heavily based on work from DavidSmith@byu.net
                    
64     * @link http://pear.php.net/package/Net_LDAP2
                    
65     * @author Benedikt Hallinger <beni@php.net>, heavily based on work from DavidSmith@byu.net
                    
                
text.php https://github.com/error10/Ushahidi_Web.git | PHP | 410 lines
                    
1<?php defined('SYSPATH') OR die('No direct access allowed.');
                    
2/**
                    
4 *
                    
5 * $Id: text.php 3917 2009-01-21 03:06:22Z zombor $
                    
6 *
                    
9 * @copyright  (c) 2007-2008 Kohana Team
                    
10 * @license    http://kohanaphp.com/license.html
                    
11 */
                    
173	{
                    
174		return preg_replace('#(?<!:)//+#', '/', $str);
                    
175	}
                    
205			$regex .= 'e';
                    
206			return preg_replace($regex, 'str_repeat($replacement, utf8::strlen(\'$1\'))', $str);
                    
207		}
                    
208
                    
209		return preg_replace($regex, $replacement, $str);
                    
210	}
                    
                
Context.php https://github.com/ratbird/hope.git | PHP | 492 lines
                    
1<?php
                    
2
                    
244        $properties = array_combine($properties, $properties);
                    
245        $properties = array_change_key_case(array_flip(preg_replace('/((?<=[a-z]|\d)[A-Z]|(?<!^)[A-Z](?=[a-z]))/',
                    
246            '_\\1', $properties)));
                    
343        $file = Util::normalizePath($file);
                    
344        $dirname = preg_replace('/[^\/\\\\]*$/', '', $file);
                    
345
                    
379            'urlArgs', // whether to add args into url tokens
                    
380            'customVariables', // variables from the php API
                    
381            'currentFileInfo', // current file information object
                    
409            'importantScope',  // used to bubble up !important statements
                    
410            'customVariables', // variables from the php API
                    
411        ];
                    
                
Db.php https://github.com/guiohm/magento-french.git | PHP | 415 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
                    
23 * @copyright   Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
                    
24 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
                    
25 */
                    
137        else {
                    
138            return preg_replace($regExp, '', $row['Create Table']) . ';';
                    
139        }
                    
                
markdown.php https://github.com/joshuaswarren/weatherhub.git | PHP | 1790 lines
                    
1<?php
                    
2#
                    
4#
                    
5# PHP Markdown & Extra
                    
6# Copyright (c) 2004-2008 Michel Fortin
                    
6# Copyright (c) 2004-2008 Michel Fortin
                    
7# <http://www.michelf.com/projects/php-markdown/>
                    
8#
                    
21	# Regex to match balanced [brackets].
                    
22	# Needed to insert a maximum bracked depth while converting to PHP.
                    
23	public $nested_brackets_depth = 6;
                    
109		# Remove UTF-8 BOM and marker character in input, if present.
                    
110		$text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text);
                    
111
                    
113		#   DOS to Unix and Mac to Unix
                    
114		$text = preg_replace('{\r\n?}', "\n", $text);
                    
115
                    
                
CDbSchema.php https://github.com/joshuaswarren/weatherhub.git | PHP | 559 lines
                    
1<?php
                    
2/**
                    
14 * @author Qiang Xue <qiang.xue@gmail.com>
                    
15 * @version $Id: CDbSchema.php 3297 2011-06-22 21:46:11Z qiang.xue $
                    
16 * @package system.db.schema
                    
70			if($this->_connection->tablePrefix!==null && strpos($name,'{{')!==false)
                    
71				$realName=preg_replace('/\{\{(.*?)\}\}/',$this->_connection->tablePrefix.'$1',$name);
                    
72			else
                    
                
Entry.php https://github.com/quarkness/piwik.git | PHP | 661 lines
                    
1<?php
                    
2/**
                    
18 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
19 * @version    $Id: Entry.php 23775 2011-03-01 17:25:24Z ralph $
                    
20 */
                    
24 */
                    
25// require_once 'Zend/Feed/Reader.php';
                    
26
                    
29 */
                    
30// require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php';
                    
31
                    
34 */
                    
35// require_once 'Zend/Date.php';
                    
36
                    
39 */
                    
40// require_once 'Zend/Uri.php';
                    
41
                    
                
Kernel.php https://github.com/Exercise/symfony.git | PHP | 757 lines
                    
1<?php
                    
2
                    
15use Symfony\Component\DependencyInjection\ContainerBuilder;
                    
16use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
                    
17use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
                    
20use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
                    
21use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
                    
22use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
                    
77        $this->rootDir = $this->getRootDir();
                    
78        $this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
                    
79        $this->classes = array();
                    
95            ErrorHandler::register($this->errorReportingLevel);
                    
96            if ('cli' !== php_sapi_name()) {
                    
97                ExceptionHandler::register();
                    
248        if (!isset($this->bundleMap[$name])) {
                    
249            throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your %s.php file?', $name, get_class($this)));
                    
250        }
                    
                
model_behavior.test.php https://github.com/cgajardo/repositorium.git | PHP | 1138 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * Long description for behavior.test.php
                    
6 *
                    
6 *
                    
7 * PHP versions 4 and 5
                    
8 *
                    
8 *
                    
9 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
10 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 *
                    
15 * @copyright     CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
16 * @link          http://cakephp.org CakePHP(tm) Project
                    
19 * @since         1.2
                    
20 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
21 */
                    
                
xml.test.php https://github.com/cgajardo/repositorium.git | PHP | 1124 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP versions 4 and 5
                    
6 *
                    
6 *
                    
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
                    
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
13 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
                    
15 * @package       cake
                    
16 * @subpackage    cake.tests.cases.libs
                    
17 * @since         CakePHP(tm) v 1.2.0.5432
                    
18 * @license       http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
                    
48		$input = '<' . '?xml version="1.0" encoding="UTF-8" ?' . '>' . "\n" .
                    
49			'<plugin id="1" version_id="1" name="my_plugin" title="My Plugin" author="Me" author_email="me@cakephp.org" description="My awesome package" created="2008-01-28 18:21:13" updated="2008-01-28 18:21:13">'
                    
50			.'<current id="1" plugin_id="1" name="1.0" file="" created="2008-01-28 18:21:13" updated="2008-01-28 18:21:13" />'
                    
                
time.php https://github.com/cgajardo/repositorium.git | PHP | 744 lines
                    
6 *
                    
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
13 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 * @link          http://cakephp.org CakePHP(tm) Project
                    
15 * @package       cake
                    
16 * @subpackage    cake.cake.libs.view.helpers
                    
17 * @since         CakePHP(tm) v 0.10.0.1076
                    
18 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
278 * @access public
                    
279 * @link http://book.cakephp.org/view/1471/Formatting
                    
280 */
                    
304 * @access public
                    
305 * @link http://book.cakephp.org/view/1472/Testing-Time
                    
306 */
                    
                
helper.php https://github.com/cgajardo/repositorium.git | PHP | 912 lines
                    
6 *
                    
7 * PHP versions 4 and 5
                    
8 *
                    
8 *
                    
9 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
10 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
15 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
16 * @link          http://cakephp.org CakePHP(tm) Project
                    
17 * @package       cake
                    
18 * @subpackage    cake.cake.libs.view
                    
19 * @since         CakePHP(tm) v 0.2.9
                    
20 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
28/**
                    
29 * Abstract base class for all other Helpers in CakePHP.
                    
30 * Provides common methods and features.
                    
                
cake_schema.php https://github.com/cgajardo/repositorium.git | PHP | 698 lines
                    
4 *
                    
5 * PHP versions 4 and 5
                    
6 *
                    
6 *
                    
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
13 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 * @link          http://cakephp.org CakePHP(tm) Project
                    
15 * @package       cake
                    
17 * @since         CakePHP(tm) v 1.2.0.5550
                    
18 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
19 */
                    
176				require_once($path . DS . $file);
                    
177			} elseif (file_exists($path . DS . 'schema.php') && is_file($path . DS . 'schema.php')) {
                    
178				require_once($path . DS . 'schema.php');
                    
                
autonav-wl.php https://bitbucket.org/wlindley/autonav.git | PHP | 1302 lines
                    
1<?php
                    
2/*
                    
92
                    
93  $pic_full	= preg_replace('#-\d+x\d+\.#','.',$pic_full); /* remove, e.g., trailing '-1024x768' */
                    
94  $info	= pathinfo($pic_full); // relative to upload directory
                    
                
roksprocket.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 582 lines
                    
1<?php
                    
2/**
                    
38			$error_string = 'RokSprocket needs the RokCommon Library and Plug-in installed and enabled. The RokCommon System Plug-in needs to be before the RokSprocket System Plug-in in the Plug-in Manager';
                    
39		} else if (!preg_match('/project.version/', ROKCOMMON) && version_compare(preg_replace('/-SNAPSHOT/', '', ROKCOMMON), self::NEEDED_ROKCOMMON_VERSION, '<')) {
                    
40			$error_string = sprintf('RokSprocket needs at least RokCommon Version %s.  You currently have RokCommon Version %s', self::NEEDED_ROKCOMMON_VERSION, ROKCOMMON);
                    
267					$body = JResponse::getBody();
                    
268					$pq   = phpQuery::newDocument($body);
                    
269
                    
                
utils.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 787 lines
                    
1<?php
                    
2/**
                    
91	{
                    
92		require_once 'jsn_readxmlfile.php';
                    
93		$jsn_readxml = new JSNReadXMLFile();
                    
133		for($i = 0, $count_key = substr_count($url, 'jsn_set'); $i < $count_key; $i ++) {
                    
134			$url = preg_replace('/(.*)(\?|&)jsn_set[a-z]{0,30}=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&');
                    
135			$url = substr($url, 0, -1);
                    
168
                    
169		require_once 'jsn_readxmlfile.php';
                    
170		$jsn_readxml = new JSNReadXMLFile();
                    
603    {
                    
604    	$url = preg_replace('/[?\#]+.*$/', '', $url);
                    
605
                    
                
JSON.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 539 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * @version   $Id: JSON.php 57548 2012-10-15 01:51:49Z btowles $
                    
4 * @author    RocketTheme http://www.rockettheme.com
                    
153		*/
                    
154		$getter_name = 'get' . ucfirst(preg_replace('/^\W+/', '', $property->getName()));
                    
155		if (!$property->getDeclaringClass()->hasMethod($getter_name)) {
                    
379		*/
                    
380		$setter_name = 'set' . ucfirst(preg_replace('/^\W+/', '', $property->getName()));
                    
381		if (!$property->getDeclaringClass()->hasMethod($setter_name)) {
                    
462	/**
                    
463	 * Method to get the data type form the PHPDoc block of a class property
                    
464	 * @static
                    
477			}
                    
478			$docComment = preg_replace('#[ \t]*(?:\/\*\*|\*\/|\*)?[ ]{0,1}(.*)?#', '$1', $docComment);
                    
479			$docComment = ltrim($docComment, "\r\n");
                    
                
form.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 791 lines
                    
1<?php
                    
2/**
                    
107			// @TODO Probably worth moving to an inflector class based on
                    
108			// http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
                    
109
                    
124				{
                    
125					$this->view_list = preg_replace($pattern[0], $pattern[1], $this->view_item);
                    
126					break;
                    
157				JRoute::_(
                    
158					'index.php?option=' . $this->option . '&view=' . $this->view_list
                    
159					. $this->getRedirectToListAppend(), false
                    
171			JRoute::_(
                    
172				'index.php?option=' . $this->option . '&view=' . $this->view_item
                    
173				. $this->getRedirectToItemAppend(), false
                    
321					JRoute::_(
                    
322						'index.php?option=' . $this->option . '&view=' . $this->view_list
                    
323						. $this->getRedirectToListAppend(), false
                    
                
table.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 1266 lines
                    
1<?php
                    
2/**
                    
172		// Sanitize and prepare the table class name.
                    
173		$type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type);
                    
174		$tableClass = $prefix . ucfirst($type);
                    
179			// Search for the class file in the JTable include paths.
                    
180			$path = JPath::find(self::addIncludePath(), strtolower($type) . '.php');
                    
181			if ($path)
                    
                
string.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 969 lines
                    
1<?php
                    
2/**
                    
11
                    
12// PHP mbstring and iconv local configuration
                    
13
                    
34 */
                    
35jimport('phputf8.utf8');
                    
36jimport('phputf8.strcasecmp');
                    
39 * String handling class for utf-8 data
                    
40 * Wraps the phputf8 library
                    
41 * All functions assume the validity of utf-8 strings.
                    
136			$n = empty($n) ? ($matches[1] + 1) : $n;
                    
137			$string = preg_replace($rxReplace, sprintf($oldFormat, $n), $string);
                    
138		}
                    
158	 *
                    
159	 * @see     http://www.php.net/strpos
                    
160	 * @since   11.1
                    
                
html.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 1007 lines
                    
1<?php
                    
2/**
                    
65	{
                    
66		$key = preg_replace('#[^A-Z0-9_\.]#i', '', $key);
                    
67
                    
111		{
                    
112			$path = JPath::find(self::$includePaths, strtolower($file) . '.php');
                    
113
                    
216	 *
                    
217	 * @see     http://php.net/manual/en/function.call-user-func-array.php
                    
218	 * @since   11.1
                    
227
                    
228		// PHP 5.3 workaround
                    
229		$temp = array();
                    
                
input.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 758 lines
                    
1<?php
                    
2/**
                    
14 *
                    
15 * Forked from the php input filter library by: Daniel Morris <dan@rootcube.com>
                    
16 * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
                    
151	/**
                    
152	 * Method to be called by another php script. Processes for XSS and
                    
153	 * specified bad code.
                    
192			case 'WORD':
                    
193				$result = (string) preg_replace('/[^A-Z_]/i', '', $source);
                    
194				break;
                    
196			case 'ALNUM':
                    
197				$result = (string) preg_replace('/[^A-Z0-9]/i', '', $source);
                    
198				break;
                    
200			case 'CMD':
                    
201				$result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source);
                    
202				$result = ltrim($result, '.');
                    
                
document.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 964 lines
                    
1<?php
                    
2/**
                    
266		{
                    
267			$type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type);
                    
268			$path = __DIR__ . '/' . $type . '/' . $type . '.php';
                    
282			{
                    
283				$path = __DIR__ . '/' . $type . '/' . $type . '.php';
                    
284				if (file_exists($path))
                    
                
driver.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 1779 lines
                    
1<?php
                    
2/**
                    
186
                    
187			// Only load for php files.
                    
188			// Note: DirectoryIterator::getExtension only available PHP >= 5.3.6
                    
188			// Note: DirectoryIterator::getExtension only available PHP >= 5.3.6
                    
189			if (!$file->isFile() || substr($fileName, strrpos($fileName, '.') + 1) != 'php')
                    
190			{
                    
194			// Derive the class name from the type.
                    
195			$class = str_ireplace('.php', '', 'JDatabaseDriver' . ucfirst(trim($fileName)));
                    
196
                    
206				// Connector names should not have file extensions.
                    
207				$connectors[] = str_ireplace('.php', '', $fileName);
                    
208			}
                    
232		// Sanitize the database connector options.
                    
233		$options['driver']   = (isset($options['driver'])) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $options['driver']) : 'mysqli';
                    
234		$options['database'] = (isset($options['database'])) ? $options['database'] : null;
                    
                
access.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 568 lines
                    
1<?php
                    
2/**
                    
94
                    
95		$action = strtolower(preg_replace('#[\s\-]+#', '.', trim($action)));
                    
96		$asset = strtolower(preg_replace('#[\s\-]+#', '.', trim($asset)));
                    
134		$groupId = (int) $groupId;
                    
135		$action = strtolower(preg_replace('#[\s\-]+#', '.', trim($action)));
                    
136		$asset = strtolower(preg_replace('#[\s\-]+#', '.', trim($asset)));
                    
                
file.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 815 lines
                    
1<?php
                    
2/**
                    
70		$manifestPath = JPath::clean($this->parent->getPath('manifest'));
                    
71		$element = preg_replace('/\.xml/', '', basename($manifestPath));
                    
72		$this->set('element', $element);
                    
                
videos.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 603 lines
                    
1<?php
                    
2/**
                    
4 * @copyright	Copyright (C) 2010 Stack Ideas Private Limited. All rights reserved.
                    
5 * @license		GNU/GPL, see LICENSE.php
                    
6 *
                    
10 * other free or open source software licenses.
                    
11 * See COPYRIGHT.php for copyright notices and details.
                    
12 */
                    
15
                    
16require_once( EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'helper.php' );
                    
17
                    
48
                    
49		return preg_replace( $pattern , $replace , $content );
                    
50	}
                    
103		{
                    
104			require_once( EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'json.php' );
                    
105
                    
                
router.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 1336 lines
                    
1<?php
                    
2/**
                    
4 * @copyright	Copyright (C) 2010 Stack Ideas Private Limited. All rights reserved.
                    
5 * @license		GNU/GPL, see LICENSE.php
                    
6 *
                    
10 * other free or open source software licenses.
                    
11 * See COPYRIGHT.php for copyright notices and details.
                    
12 */
                    
17
                    
18require_once( JPATH_ROOT. DIRECTORY_SEPARATOR .'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'constants.php' );
                    
19require_once( EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'helper.php' );
                    
84			//replace double byte whitespaces by single byte (Far-East languages)
                    
85			$str = preg_replace('/\xE3\x80\x80/', ' ', $string);
                    
86
                    
93			// replace forbidden characters by whitespaces
                    
94			$str = preg_replace( '#[:\#\*"@+=;!&\.%()\]\/\'\\\\|\[]#',"\x20", $str );
                    
95
                    
                
toolbar.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 714 lines
                    
1<?php
                    
2/**
                    
37		{
                    
38			$icon = 'icon-48-' . preg_replace('#\.[^.]*$#', '', $icon);
                    
39		}
                    
97		// Strip extension.
                    
98		$icon = preg_replace('#\.[^.]*$#', '', $icon);
                    
99
                    
175		// Add an upload button.
                    
176		$bar->appendButton('Popup', 'upload', $alt, 'index.php?option=com_media&tmpl=component&task=popupUpload&folder=' . $directory, 800, 520);
                    
177	}
                    
                
profiles.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 468 lines
                    
1<?php
                    
2
                    
53        $msg = JText::sprintf('WF_PROFILES_DELETED', count($cid));
                    
54        $this->setRedirect('index.php?option=com_jce&view=profiles', $msg);
                    
55    }
                    
89        $msg = JText::sprintf('WF_PROFILES_COPIED', $n);
                    
90        $this->setRedirect('index.php?option=com_jce&view=profiles', $msg);
                    
91    }
                    
132                case 'plugins':
                    
133                    $value = preg_replace('#[^\w,]+#', '', $value);
                    
134                    break;
                    
135                case 'rows':
                    
136                    $value = preg_replace('#[^\w,;]+#', '', $value);
                    
137                    break;
                    
194                $msg = JText::sprintf('WF_PROFILES_SAVED_CHANGES', $row->name);
                    
195                $this->setRedirect('index.php?option=com_jce&view=profiles&task=edit&cid[]=' . $row->id, $msg);
                    
196                break;
                    
                
markdown.php https://bitbucket.org/Maron1/taqman.git | PHP | 1793 lines
                    
1<?php
                    
2#
                    
4#
                    
5# PHP Markdown & Extra
                    
6# Copyright (c) 2004-2012 Michel Fortin  
                    
6# Copyright (c) 2004-2012 Michel Fortin  
                    
7# <http://michelf.com/projects/php-markdown/>
                    
8#
                    
71Plugin Name: Markdown Extra
                    
72Plugin URI: http://michelf.com/projects/php-markdown/
                    
73Description: <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>
                    
144			$text = '<p>'.$text.'</p>';
                    
145			$text = preg_replace('{\n{2,}}', "</p>\n\n<p>", $text);
                    
146		}
                    
149	
                    
150	function mdwp_strip_p($t) { return preg_replace('{</?p>}i', '', $t); }
                    
151
                    
                
question.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 438 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
128    public function make_html_inline($html) {
                    
129        $html = preg_replace('~\s*<p>\s*~u', '', $html);
                    
130        $html = preg_replace('~\s*</p>\s*~u', '<br />', $html);
                    
130        $html = preg_replace('~\s*</p>\s*~u', '<br />', $html);
                    
131        $html = preg_replace('~(<br\s*/?>)+$~u', '', $html);
                    
132        return trim($html);
                    
                
format.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 665 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
46                 "'&(copy|#169);'i",
                    
47                 "'&#(\d+);'e");  // Evaluate like PHP
                    
48    $replace = array ("",
                    
60                  "chr(\\1)");
                    
61    return preg_replace ($search, $replace, $string);
                    
62}
                    
75        $formula = str_replace(
                    
76                $regs[0], preg_replace('/[)(]/', '', $regs[0]), $formula);
                    
77    }
                    
91
                    
92    // Replace all other base**exp with the PHP equivalent function pow(base,exp)
                    
93    // (Pretty tricky to exchange an operator with a function)
                    
                
locallib.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 566 lines
                    
1<?php
                    
2
                    
28
                    
29require_once("$CFG->libdir/filelib.php");
                    
30require_once("$CFG->libdir/resourcelib.php");
                    
30require_once("$CFG->libdir/resourcelib.php");
                    
31require_once("$CFG->dirroot/mod/url/lib.php");
                    
32
                    
94        $allowed = "a-zA-Z0-9".preg_quote(';/?:@=&$_.+!*(),-#%', '/');
                    
95        $fullurl = preg_replace_callback("/[^$allowed]/", 'url_filter_callback', $fullurl);
                    
96    } else {
                    
224        $exteurl = url_get_full_url($url, $cm, $course, $config);
                    
225        $navurl = "$CFG->wwwroot/mod/url/view.php?id=$cm->id&amp;frameset=top";
                    
226        $coursecontext = context_course::instance($course->id);
                    
356    if (strpos($url->externalurl, $CFG->wwwroot) === 0) {
                    
357        if (strpos($url->externalurl, 'file.php') === false and strpos($url->externalurl, '.php') !== false ) {
                    
358            // most probably our moodle page with navigation
                    
                
TextData.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 598 lines
                    
22 * @package		PHPExcel_Calculation
                    
23 * @copyright	Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
                    
24 * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
                    
34	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
                    
35	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
                    
36}
                    
338		if (is_bool($value)) {
                    
339			$value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
                    
340		}
                    
416		if (is_bool($value)) {
                    
417			$value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
                    
418		}
                    
485		if (is_bool($mixedCaseString)) {
                    
486			$mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
                    
487		}
                    
                
LookupRef.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 808 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * PHPExcel
                    
4 *
                    
4 *
                    
5 * Copyright (c) 2006 - 2012 PHPExcel
                    
6 *
                    
22 * @package		PHPExcel_Calculation
                    
23 * @copyright	Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
                    
24 * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
                    
34	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
                    
35	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
                    
36}
                    
43 * @package		PHPExcel_Calculation
                    
44 * @copyright	Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
                    
45 */
                    
                
DirectLex.php https://bitbucket.org/kudutest1/moodlegit.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        }
                    
                
zip_archive.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 814 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
26
                    
27require_once("$CFG->libdir/filestorage/file_archive.php");
                    
28
                    
62
                    
63    /** @var bool ugly hack for broken empty zip handling in < PHP 5.3.10 */
                    
64    protected $emptyziphack = false;
                    
93            case file_archive::OPEN:      $flags = 0; break;
                    
94            case file_archive::OVERWRITE: $flags = ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE; break; //changed in PHP 5.2.8
                    
95            case file_archive::CREATE:
                    
101        if ($flags == 0 and $result === ZIPARCHIVE::ER_NOZIP and filesize($archivepathname) === 22) {
                    
102            // Legacy PHP versions < 5.3.10 can not deal with empty zip archives.
                    
103            if (file_get_contents($archivepathname) === base64_decode(self::$emptyzipcontent)) {
                    
147        $result = str_replace('\\', '/', $localname);   // no MS \ separators
                    
148        $result = preg_replace('/\.\.+/', '', $result); // prevent /.../
                    
149        $result = ltrim($result, '/');                  // no leading slash
                    
                
plugin.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 442 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
171        // Try to add after given plugin.
                    
172        $params[$field] = preg_replace('~(,|^)(' . preg_quote($after) . ')(,|$)~',
                    
173                '$1$2,' . $button . '$3', $old);
                    
221        // Try to add after given plugin.
                    
222        $params[$field] = preg_replace('~(,|^)(' . preg_quote($before) . ')(,|$)~',
                    
223                '$1' . $button . ',$2$3', $old);
                    
316     * for client-side use such as loading JavaScript files. (This URL normally
                    
317     * goes through loader.php and contains the plugin version to ensure
                    
318     * correct and long-term cacheing.)
                    
325
                    
326        // Version number comes from plugin version.php, except in developer
                    
327        // mode where the special string 'dev' is used (prevents cacheing and
                    
337        if ($CFG->slasharguments) {
                    
338            // URL is usually from loader.php...
                    
339            $jsurl = 'loader.php/' . $this->plugin . '/' . $version . '/' . $file;
                    
                
postgres_sql_generator.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 535 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
27
                    
28require_once($CFG->libdir.'/ddl/sql_generator.php');
                    
29
                    
101        $sqlarr = $this->getCreateTableSQL($xmldb_table);
                    
102        $sqlarr = preg_replace('/^CREATE TABLE/', "CREATE TEMPORARY TABLE", $sqlarr);
                    
103        return $sqlarr;
                    
139                $count = 0;
                    
140                $newindex = preg_replace("/^CREATE( UNIQUE)? INDEX ([a-z0-9_]+) ON ([a-z0-9_]+) \($field\)$/", "CREATE INDEX \\2_pattern ON \\3 USING btree ($field varchar_pattern_ops)", $sql, -1, $count);
                    
141                if ($count != 1) {
                    
                
oracle_sql_generator.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 706 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
27
                    
28require_once($CFG->libdir.'/ddl/sql_generator.php');
                    
29
                    
143        $sqlarr = $this->getCreateTableSQL($xmldb_table);
                    
144        $sqlarr = preg_replace('/^CREATE TABLE (.*)/s', 'CREATE GLOBAL TEMPORARY TABLE $1 ON COMMIT PRESERVE ROWS', $sqlarr);
                    
145        return $sqlarr;
                    
                
adodb-xmlschema03.inc.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 1921 lines
                    
1<?php
                    
2// Copyright (c) 2004-2005 ars Cognita Inc., all rights reserved
                    
112if( !defined( '_ADODB_LAYER' ) ) {
                    
113	require( 'adodb.inc.php' );
                    
114	require( 'adodb-datadict.inc.php' );
                    
208	function FieldID( $field ) {
                    
209		return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );
                    
210	}
                    
                
adodb-xmlschema.inc.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 1985 lines
                    
1<?php
                    
2// Copyright (c) 2004 ars Cognita Inc., all rights reserved
                    
94if( !defined( '_ADODB_LAYER' ) ) {
                    
95	require( 'adodb.inc.php' );
                    
96	require( 'adodb-datadict.inc.php' );
                    
190	function FieldID( $field ) {
                    
191		return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );
                    
192	}
                    
                
weblib.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 1437 lines
                    
1<?php
                    
2
                    
20 *
                    
21 * Library of all general-purpose Moodle PHP functions and constants
                    
22 * that produce HTML output
                    
24 * Other main libraries:
                    
25 * - datalib.php - functions that access the database.
                    
26 * - moodlelib.php - general-purpose Moodle functions.
                    
99
                    
100    return preg_replace("/&amp;#(\d+|x[0-7a-fA-F]+);/i", "&#$1;", htmlspecialchars($var, ENT_QUOTES, 'UTF-8', true));
                    
101}
                    
184 *
                    
185 * This function is necessary because PHP_SELF and REQUEST_URI and SCRIPT_NAME
                    
186 * return different things depending on a lot of things like your OS, Web
                    
186 * return different things depending on a lot of things like your OS, Web
                    
187 * server, and the way PHP is compiled (ie. as a CGI, module, ISAPI, etc.)
                    
188 * <b>NOTE:</b> This function returns false if the global variables needed are not set.
                    
                
oauthlib.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 632 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
19
                    
20require_once($CFG->libdir.'/filelib.php');
                    
21
                    
151            strtoupper($http_method),
                    
152            preg_replace('/%7E/', '~', rawurlencode($url)),
                    
153            rawurlencode($this->get_signable_parameters($params)),
                    
                
excellib.class.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 861 lines
                    
54        global $CFG;
                    
55        require_once("$CFG->libdir/phpexcel/PHPExcel.php");
                    
56
                    
56
                    
57        $this->objPHPExcel = new PHPExcel();
                    
58        $this->objPHPExcel->removeSheetByIndex(0);
                    
131
                    
132        $objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, $this->type);
                    
133        $objWriter->save('php://output');
                    
155class MoodleExcelWorksheet {
                    
156    /** @var PHPExcel_Worksheet */
                    
157    protected $worksheet;
                    
232        $getdate = usergetdate($date);
                    
233        $exceldate = PHPExcel_Shared_Date::FormattedPHPToExcel(
                    
234            $getdate['year'],
                    
                
csvlib.class.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 542 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
91        // Fix mac/dos newlines
                    
92        $content = preg_replace('!\r\n?!', "\n", $content);
                    
93        // Remove any spaces or new lines at the end of the file.
                    
                
algebradebug.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 354 lines
                    
7
                    
8    require_once("../../config.php");
                    
9
                    
92  $algebra = str_replace('upsilon','zupslon',$algebra);
                    
93  $algebra = preg_replace('!\r\n?!',' ',$algebra);
                    
94  $algebra = escapeshellarg($algebra);
                    
95
                    
96  if ( (PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "Windows") ) {
                    
97    $cmd  = "cd $CFG->dirroot\\filter\\algebra & algebra2tex.pl x/2";
                    
177  $texexp = preg_replace('/\\\log\\\left\((.+?),(.+?)\\\right\)/s','\log_{'. "\$2}\\left(\$1\\right)",$texexp);
                    
178  $texexp = preg_replace('/(\\\cos|\\\sin|\\\tan|\\\sec|\\\csc|\\\cot)([h]*)\\\left\((.+?),(.+?)\\\right\)/s',"\$1\$2^{". "\$4}\\left(\$3\\right)",$texexp);
                    
179  $texexp = preg_replace('/\\\int\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\int_'. "{\$2}^{\$3}\$1 ",$texexp);
                    
180  $texexp = preg_replace('/\\\int\\\left\((.+?d[a-z])\\\right\)/s','\int '. "\$1 ",$texexp);
                    
181  $texexp = preg_replace('/\\\lim\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\lim_'. "{\$2\\to \$3}\$1 ",$texexp);
                    
182  return $texexp;
                    
                
lib.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 690 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
134        } else {
                    
135            $path = make_cache_directory('cachestore_file/'.preg_replace('#[^a-zA-Z0-9\.\-_]+#', '', $name));
                    
136        }
                    
234        $this->definition = $definition;
                    
235        $hash = preg_replace('#[^a-zA-Z0-9]+#', '_', $this->definition->get_id());
                    
236        $this->path = $this->filestorepath.'/'.$hash;
                    
331        // HACK ALERT
                    
332        // There is a problem when reading from the file during PHPUNIT tests. For one reason or another the filesize is not correct
                    
333        // Doesn't happen during normal operation, just during unit tests.
                    
                
view_table_php.class.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 921 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
23/**
                    
24 * This class will show the PHP needed (upgrade block) to perform
                    
25 * the desired DDL action with the specified field/key/index
                    
30 */
                    
31class view_table_php extends XMLDBAction {
                    
32
                    
103        $origfieldkeyindexparam = optional_param('fieldkeyindex', $defaultfieldkeyindex, PARAM_PATH);
                    
104        $fieldkeyindexparam = preg_replace('/[fki]#/i', '', $origfieldkeyindexparam); // Strip the initials
                    
105        $fieldkeyindexinitial = substr($origfieldkeyindexparam, 0, 1); //To know what we have selected
                    
108        $b = ' <p class="centerpara buttons">';
                    
109        $b .= '<a href="index.php?action=edit_table&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&amp;table=' . $tableparam . '">[' . $this->str['back'] . ']</a>';
                    
110        $b .= '</p>';
                    
159        // Now build the form
                    
160        $o.= '<form id="form" action="index.php" method="post">';
                    
161        $o.= '<div>';
                    
                
install.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 612 lines
                    
38
                    
39// If config.php exists we just created config.php and need to redirect to continue installation
                    
40$configfile = './config.php';
                    
61if (version_compare(phpversion(), '5.3.3') < 0) {
                    
62    $phpversion = phpversion();
                    
63    // do NOT localise - lang strings would not work here and we CAN not move it after installib
                    
63    // do NOT localise - lang strings would not work here and we CAN not move it after installib
                    
64    echo "Moodle 2.5 or later requires at least PHP 5.3.3 (currently using version $phpversion).<br />";
                    
65    echo "Please upgrade your server software or install older Moodle version.";
                    
153
                    
154// Fake some settings so that we can use selected functions from moodlelib.php and weblib.php
                    
155$CFG = new stdClass();
                    
269        if ($hint_database === '') {
                    
270            $configphp = install_generate_configphp($database, $CFG);
                    
271
                    
                
widgets.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 1259 lines
                    
1<?php
                    
2/**
                    
73	/**
                    
74	 * PHP4 constructor
                    
75	 */
                    
80	/**
                    
81	 * PHP5 constructor
                    
82	 *
                    
93	function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
                    
94		$this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base);
                    
95		$this->name = $name;
                    
                
rewrite.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 1688 lines
                    
1<?php
                    
2/**
                    
254 *
                    
255 * To remove any manually prepended /index.php/.
                    
256 *
                    
264	if ( !empty( $base ) ) {
                    
265		$base = preg_replace( '|^/index\.php/|', '', $base );
                    
266		$base = trim( $base, '/' );
                    
315
                    
316	// Strip 'index.php/' if we're not using path info permalinks
                    
317	if ( !$wp_rewrite->using_index_permalinks() )
                    
317	if ( !$wp_rewrite->using_index_permalinks() )
                    
318		$url = str_replace('index.php/', '', $url);
                    
319
                    
353			// Trim the query of everything up to the '?'.
                    
354			$query = preg_replace("!^.+\?!", '', $query);
                    
355
                    
                
post-template.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 1460 lines
                    
1<?php
                    
2/**
                    
224	if ( $preview ) // preview fix for javascript bug with foreign languages
                    
225		$output =	preg_replace_callback('/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output);
                    
226
                    
234 * @access private
                    
235 * @param array $match Match array from preg_replace_callback
                    
236 * @return string
                    
                
ms-blogs.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 773 lines
                    
1<?php
                    
2
                    
52		if ( !empty( $blogname ) )
                    
53			$url = preg_replace( '|^([^\.]+://)|', '$1' . $blogname . '.', $url );
                    
54	} else {
                    
                
load.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 761 lines
                    
89	// Fix empty PHP_SELF
                    
90	$PHP_SELF = $_SERVER['PHP_SELF'];
                    
91	if ( empty( $PHP_SELF ) )
                    
91	if ( empty( $PHP_SELF ) )
                    
92		$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );
                    
93}
                    
107		wp_load_translations_early();
                    
108		die( sprintf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version ) );
                    
109	}
                    
396	} else if ( !$_wp_using_ext_object_cache && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
                    
397		// Sometimes advanced-cache.php can load object-cache.php before it is loaded here.
                    
398		// This breaks the function_exists check above and can result in $_wp_using_ext_object_cache
                    
428			wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
                    
429	} elseif ( ! is_blog_installed() && false === strpos( $_SERVER['PHP_SELF'], 'install.php' ) && !defined( 'WP_INSTALLING' ) ) {
                    
430
                    
                
functions.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 1652 lines
                    
1<?php
                    
2/**
                    
7
                    
8require( ABSPATH . WPINC . '/option.php' );
                    
9
                    
12 *
                    
13 * $format should be either a PHP date format string, e.g. 'U' for a Unix
                    
14 * timestamp, or 'G' for a Unix timestamp assuming that $date is GMT.
                    
111		$dateformatstring = ' '.$dateformatstring;
                    
112		$dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
                    
113		$dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
                    
113		$dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
                    
114		$dateformatstring = preg_replace( "/([^\\\])l/", "\\1" . backslashit( $dateweekday ), $dateformatstring );
                    
115		$dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
                    
115		$dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
                    
116		$dateformatstring = preg_replace( "/([^\\\])a/", "\\1" . backslashit( $datemeridiem ), $dateformatstring );
                    
117		$dateformatstring = preg_replace( "/([^\\\])A/", "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
                    
                
default-widgets.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 1201 lines
                    
65	?>
                    
66		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
                    
67		<p>
                    
75		<p>
                    
76			<label for="<?php echo $this->get_field_id('exclude'); ?>"><?php _e( 'Exclude:' ); ?></label> <input type="text" value="<?php echo $exclude; ?>" name="<?php echo $this->get_field_name('exclude'); ?>" id="<?php echo $this->get_field_id('exclude'); ?>" class="widefat" />
                    
77			<br />
                    
214?>
                    
215		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
                    
216<?php
                    
282		<p>
                    
283			<input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown'); ?></label>
                    
284			<br/>
                    
284			<br/>
                    
285			<input class="checkbox" type="checkbox" <?php echo $count; ?> id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" /> <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Show post counts'); ?></label>
                    
286		</p>
                    
                
class-wp.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 645 lines
                    
1<?php
                    
2/**
                    
152			$req_uri = $req_uri_array[0];
                    
153			$self = $_SERVER['PHP_SELF'];
                    
154			$home_path = parse_url(home_url());
                    
166			$req_uri = trim($req_uri, '/');
                    
167			$req_uri = preg_replace("|^$home_path|i", '', $req_uri);
                    
168			$req_uri = trim($req_uri, '/');
                    
169			$pathinfo = trim($pathinfo, '/');
                    
170			$pathinfo = preg_replace("|^$home_path|i", '', $pathinfo);
                    
171			$pathinfo = trim($pathinfo, '/');
                    
172			$self = trim($self, '/');
                    
173			$self = preg_replace("|^$home_path|i", '', $self);
                    
174			$self = trim($self, '/');
                    
221				// Trim the query of everything up to the '?'.
                    
222				$query = preg_replace("!^.+\?!", '', $query);
                    
223
                    
                
canonical.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 536 lines
                    
55
                    
56	// Some PHP setups turn requests for / into /index.php in REQUEST_URI
                    
57	// See: http://trac.wordpress.org/ticket/5017
                    
59	// Disabled, for now:
                    
60	// $original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
                    
61
                    
244					'wp-feed.php'         => get_default_feed(),
                    
245					'wp-rdf.php'          => 'rdf',
                    
246					'wp-rss.php'          => 'rss2',
                    
246					'wp-rss.php'          => 'rss2',
                    
247					'wp-rss2.php'         => 'rss2',
                    
248				);
                    
274
                    
275			$redirect['path'] = user_trailingslashit( preg_replace('|/index.php/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/
                    
276			if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/index.php/') === false )
                    
                
admin-bar.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 770 lines
                    
1<?php
                    
2/**
                    
24	/* Load the admin bar class code ready for instantiation */
                    
25	require( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
                    
26
                    
77		'title' => '<span class="ab-icon"></span>',
                    
78		'href'  => self_admin_url( 'about.php' ),
                    
79		'meta'  => array(
                    
89			'title'  => __('About WordPress'),
                    
90			'href'  => self_admin_url( 'about.php' ),
                    
91		) );
                    
221	if ( empty( $blogname ) )
                    
222		$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
                    
223
                    
255				'title'  => __( 'Edit Site' ),
                    
256				'href'   => network_admin_url( 'site-info.php?id=' . get_current_blog_id() ),
                    
257			) );
                    
                
admin.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 911 lines
                    
176	<?php else: ?>
                    
177	<h2 class="ak-header"><?php printf( __( 'Akismet <a href="%s" class="add-new-h2">Stats</a>' ), esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ) ); ?></h2>
                    
178	<?php endif; ?>
                    
205						<td>
                    
206							<input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_html( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $key_status;?>"><div class="under-input key-status <?php echo $key_status;?>"><?php echo ucfirst( $key_status );?></div>
                    
207							<p class="need-key description"><?php printf( __('You must enter a valid Akismet API key here. If you need an API key, you can <a href="%s">create one here</a>'), '#' );?></p>
                    
215							<label for="akismet_discard_month" title="<?php echo esc_attr( __( 'Auto-detete old spam' ) ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></span></label><br>
                    
216							<label for="akismet_show_user_comments_approved" title="<?php echo esc_attr( __( 'Show approved comments' ) ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></span></label>
                    
217							</fieldset>
                    
266								<thead>
                    
267										<th><?php _e('Akismet server'); ?></th><th><?php _e('Network Status'); ?></th>
                    
268								</thead>
                    
274											<td align="center"><?php echo esc_html( $ip ); ?></td>
                    
275											<td class="key-status <?php echo $status ? 'valid' : 'failed'; ?>"><?php echo $status ? __('Accessible') : __('Re-trying'); ?></td>
                    
276										</tr>										
                    
                
media.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 1524 lines
                    
163/**
                    
164 * Private preg_replace callback used in image_add_caption()
                    
165 *
                    
170	// remove any line breaks from inside the tags
                    
171	return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] );
                    
172}
                    
185var win = window.dialogArguments || opener || parent || top;
                    
186win.send_to_editor('<?php echo addslashes($html); ?>');
                    
187/* ]]> */
                    
329?>
                    
330<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; <?php _e('WordPress'); ?></title>
                    
331<?php
                    
342addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
                    
343var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
                    
344var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
                    
                
file.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 1071 lines
                    
20	'footer.php' => __( 'Footer' ),
                    
21	'header.php' => __( 'Header' ),
                    
22	'sidebar.php' => __( 'Sidebar' ),
                    
33	'functions.php' => __( 'Theme Functions' ),
                    
34	'attachment.php' => __( 'Attachment Template' ),
                    
35	'image.php' => __('Image Attachment Template'),
                    
35	'image.php' => __('Image Attachment Template'),
                    
36	'video.php' => __('Video Attachment Template'),
                    
37	'audio.php' => __('Audio Attachment Template'),
                    
38	'application.php' => __('Application Attachment Template'),
                    
39	'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ),
                    
40	'.htaccess' => __( '.htaccess (for rewrite rules )' ),
                    
292		else
                    
293			$error_msg = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' );
                    
294		return call_user_func($upload_error_handler, $file, $error_msg);
                    
                
press-this.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 654 lines
                    
155				<a href="#" class="select">
                    
156					<img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" />
                    
157				</a>
                    
221					type: "GET",
                    
222					url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
                    
223					cache : false,
                    
290
                    
291		jQuery('#extra-fields').html('<div class="postbox"><h2><?php _e( 'Add Photos' ); ?> <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="button button-small"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
                    
292		jQuery('#img_container').html(strtoappend);
                    
306var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
                    
307var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
                    
308var photostorage = false;
                    
349			case 'video' :
                    
350				jQuery('#extra-fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() {
                    
351					<?php
                    
                
network.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 543 lines
                    
1<?php
                    
2/**
                    
15/** WordPress Administration Bootstrap */
                    
16require_once( './admin.php' );
                    
17
                    
22	if ( ! is_network_admin() ) {
                    
23		wp_redirect( network_admin_url( 'setup.php' ) );
                    
24		exit;
                    
53function allow_subdomain_install() {
                    
54	$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
                    
55	if( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) )
                    
215			<tr>
                    
216				<th><label><input type='radio' name='subdomain_install' value='1'<?php checked( $subdomain_install ); ?> /> <?php _e( 'Sub-domains' ); ?></label></th>
                    
217				<td><?php printf( _x( 'like <code>site1.%1$s</code> and <code>site2.%1$s</code>', 'subdomain examples' ), $hostname ); ?></td>
                    
219			<tr>
                    
220				<th><label><input type='radio' name='subdomain_install' value='0'<?php checked( ! $subdomain_install ); ?> /> <?php _e( 'Sub-directories' ); ?></label></th>
                    
221				<td><?php printf( _x( 'like <code>%1$s/site1</code> and <code>%1$s/site2</code>', 'subdirectory examples' ), $hostname ); ?></td>
                    
                
wp-signup.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 442 lines
                    
100            <label class="checkbox" for="blog_public_on">
                    
101                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
                    
102                <strong><?php _e( 'Yes' ); ?></strong>
                    
104            <label class="checkbox" for="blog_public_off">
                    
105                <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
                    
106                <strong><?php _e( 'No' ); ?></strong>
                    
136	<?php } ?>
                    
137	<input name="user_email" type="text" 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.)') ?>
                    
138	<?php
                    
190	</form>
                    
191	<?php
                    
192}
                    
220	<p>
                    
221		<?php printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site. <a href="%3$s">Log in</a> as &#8220;%4$s&#8221; using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name ) ?>
                    
222	</p>
                    
                
OMBuilder.php https://github.com/1989gaurav/Propel.git | PHP | 542 lines
                    
1<?php
                    
2
                    
10
                    
11require_once dirname(__FILE__) . '/../DataModelBuilder.php';
                    
12
                    
15 *
                    
16 * OM-building classes are those that build a PHP (or other) class to service
                    
17 * a single table.  This includes Peer classes, Entity classes, Map classes,
                    
32	/**
                    
33	 * Builds the PHP source for current class and returns it as a string.
                    
34	 *
                    
36	 * In most cases this method will not need to be overridden by subclasses.  This method
                    
37	 * does assume that the output language is PHP code, so it will need to be overridden if
                    
38	 * this is not the case.
                    
39	 *
                    
40	 * @return     string The resulting PHP sourcecode.
                    
41	 */
                    
                
rewrite.php https://github.com/muskmelon/Greemo.git | PHP | 1720 lines
                    
225 *
                    
226 * To remove any manually prepended /index.php/.
                    
227 *
                    
235	if ( !empty( $base ) ) {
                    
236		$base = preg_replace( '|^/index\.php/|', '', $base );
                    
237		$base = trim( $base, '/' );
                    
286
                    
287	// Strip 'index.php/' if we're not using path info permalinks
                    
288	if ( !$wp_rewrite->using_index_permalinks() )
                    
288	if ( !$wp_rewrite->using_index_permalinks() )
                    
289		$url = str_replace('index.php/', '', $url);
                    
290
                    
478	 * The difference between the root property is that WordPress might be
                    
479	 * located at example/WordPress/index.php, if permalinks are turned off. The
                    
480	 * WordPress/index.php will be the front portion. If permalinks are turned
                    
                
post-template.php https://github.com/muskmelon/Greemo.git | PHP | 1440 lines
                    
1<?php
                    
2/**
                    
225	if ( $preview ) // preview fix for javascript bug with foreign languages
                    
226		$output =	preg_replace_callback('/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output);
                    
227
                    
235 * @access private
                    
236 * @param array $match Match array from preg_replace_callback
                    
237 * @returns string
                    
                
meta.php https://github.com/muskmelon/Greemo.git | PHP | 610 lines
                    
1<?php
                    
2/**
                    
305	if ( !is_array($object_ids) ) {
                    
306		$object_ids = preg_replace('|[^0-9,]|', '', $object_ids);
                    
307		$object_ids = explode(',', $object_ids);
                    
                
load.php https://github.com/muskmelon/Greemo.git | PHP | 654 lines
                    
89	// Fix empty PHP_SELF
                    
90	$PHP_SELF = $_SERVER['PHP_SELF'];
                    
91	if ( empty( $PHP_SELF ) )
                    
91	if ( empty( $PHP_SELF ) )
                    
92		$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );
                    
93}
                    
111	if ( version_compare( $required_php_version, $php_version, '>' ) )
                    
112		die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.'/*/WP_I18N_OLD_PHP*/, $php_version, $wp_version, $required_php_version ) );
                    
113
                    
263	if ( WP_DEBUG ) {
                    
264		// E_DEPRECATED is a core PHP constant in PHP 5.3. Don't define this yourself.
                    
265		// The two statements are equivalent, just one is for 5.3+ and for less than 5.3.
                    
394	} else if ( !$_wp_using_ext_object_cache && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
                    
395		// Sometimes advanced-cache.php can load object-cache.php before it is loaded here.
                    
396		// This breaks the function_exists check above and can result in $_wp_using_ext_object_cache
                    
                
functions.php https://github.com/muskmelon/Greemo.git | PHP | 1672 lines
                    
1<?php
                    
2/**
                    
19 *
                    
20 * @param string $dateformatstring Either 'G', 'U', or php date format.
                    
21 * @param string $mysqlstring Time from mysql DATETIME field.
                    
111		$dateformatstring = ' '.$dateformatstring;
                    
112		$dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
                    
113		$dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
                    
113		$dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
                    
114		$dateformatstring = preg_replace( "/([^\\\])l/", "\\1" . backslashit( $dateweekday ), $dateformatstring );
                    
115		$dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
                    
115		$dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
                    
116		$dateformatstring = preg_replace( "/([^\\\])a/", "\\1" . backslashit( $datemeridiem ), $dateformatstring );
                    
117		$dateformatstring = preg_replace( "/([^\\\])A/", "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
                    
131					$dateformatstring = ' '.$dateformatstring;
                    
132					$dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring );
                    
133					$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
                    
                
formatting.php https://github.com/muskmelon/Greemo.git | PHP | 1427 lines
                    
1<?php
                    
2/**
                    
82			// regular expressions
                    
83			$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
                    
84		}
                    
84		}
                    
85		$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&#038;$1', $curl);
                    
86	}
                    
132/**
                    
133 * Accepts matches array from preg_replace_callback in wpautop() or a string.
                    
134 *
                    
174	$pee = $pee . "\n"; // just to make things a little easier, pad the end
                    
175	$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
                    
176	// Space things out a little
                    
177	$allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
                    
178	$pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
                    
179	$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
                    
                
default-widgets.php https://github.com/muskmelon/Greemo.git | PHP | 1158 lines
                    
65	?>
                    
66		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
                    
67		<p>
                    
75		<p>
                    
76			<label for="<?php echo $this->get_field_id('exclude'); ?>"><?php _e( 'Exclude:' ); ?></label> <input type="text" value="<?php echo $exclude; ?>" name="<?php echo $this->get_field_name('exclude'); ?>" id="<?php echo $this->get_field_id('exclude'); ?>" class="widefat" />
                    
77			<br />
                    
195?>
                    
196		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
                    
197<?php
                    
261?>
                    
262		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
                    
263		<p>
                    
316?>
                    
317			<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
                    
318<?php
                    
                
class-wp.php https://github.com/muskmelon/Greemo.git | PHP | 599 lines
                    
1<?php
                    
2/**
                    
149			$req_uri = $req_uri_array[0];
                    
150			$self = $_SERVER['PHP_SELF'];
                    
151			$home_path = parse_url(home_url());
                    
163			$req_uri = trim($req_uri, '/');
                    
164			$req_uri = preg_replace("|^$home_path|", '', $req_uri);
                    
165			$req_uri = trim($req_uri, '/');
                    
166			$pathinfo = trim($pathinfo, '/');
                    
167			$pathinfo = preg_replace("|^$home_path|", '', $pathinfo);
                    
168			$pathinfo = trim($pathinfo, '/');
                    
169			$self = trim($self, '/');
                    
170			$self = preg_replace("|^$home_path|", '', $self);
                    
171			$self = trim($self, '/');
                    
189				// Don't try to match against AtomPub calls
                    
190				if ( $req_uri == 'wp-app.php' )
                    
191					break;
                    
                
canonical.php https://github.com/muskmelon/Greemo.git | PHP | 433 lines
                    
53
                    
54	// Some PHP setups turn requests for / into /index.php in REQUEST_URI
                    
55	// See: http://trac.wordpress.org/ticket/5017
                    
57	// Disabled, for now:
                    
58	// $original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
                    
59
                    
243
                    
244			$redirect['path'] = user_trailingslashit( preg_replace('|/index.php/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/
                    
245			if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/index.php/') === false )
                    
245			if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/index.php/') === false )
                    
246				$redirect['path'] = trailingslashit($redirect['path']) . 'index.php/';
                    
247			if ( !empty( $addl_path ) )
                    
285	// trailing /index.php
                    
286	$redirect['path'] = preg_replace('|/index.php/*?$|', '/', $redirect['path']);
                    
287
                    
                
media.php https://github.com/muskmelon/Greemo.git | PHP | 1568 lines
                    
173</script>
                    
174<?php
                    
175	exit;
                    
265	$file = $file['file'];
                    
266	$title = preg_replace('/\.[^.]+$/', '', basename($file));
                    
267	$content = '';
                    
312<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    
313<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
                    
314<head>
                    
315<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
                    
316<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; <?php _e('WordPress'); ?></title>
                    
317<?php
                    
329addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
                    
330var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
                    
331var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
                    
                
press-this.php https://github.com/muskmelon/Greemo.git | PHP | 652 lines
                    
160				<a href="#" class="select">
                    
161					<img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" />
                    
162				</a>
                    
164
                    
165			<p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p>
                    
166			<?php break;
                    
314		}
                    
315			jQuery('#extra-fields').html('<div class="postbox"><h2><?php _e( 'Add Photos' ); ?> <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="thickbox button"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
                    
316			jQuery('#img_container').html(strtoappend);
                    
339var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
                    
340var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
                    
341var photostorage = false;
                    
377			case 'video' :
                    
378				jQuery('#extra-fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() {
                    
379					<?php
                    
                
network.php https://github.com/muskmelon/Greemo.git | PHP | 548 lines
                    
1<?php
                    
2/**
                    
15/** WordPress Administration Bootstrap */
                    
16require_once( './admin.php' );
                    
17
                    
22	if ( ! is_network_admin() ) {
                    
23		wp_redirect( network_admin_url( 'setup.php' ) );
                    
24		exit;
                    
53function allow_subdomain_install() {
                    
54	$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'siteurl' ) );
                    
55	if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) )
                    
215			<tr>
                    
216				<th><label><input type='radio' name='subdomain_install' value='1'<?php checked( $subdomain_install ); ?> /> <?php _e( 'Sub-domains' ); ?></label></th>
                    
217				<td><?php printf( _x( 'like <code>site1.%1$s</code> and <code>site2.%1$s</code>', 'subdomain examples' ), $hostname ); ?></td>
                    
219			<tr>
                    
220				<th><label><input type='radio' name='subdomain_install' value='0'<?php checked( ! $subdomain_install ); ?> /> <?php _e( 'Sub-directories' ); ?></label></th>
                    
221				<td><?php printf( _x( 'like <code>%1$s/site1</code> and <code>%1$s/site2</code>', 'subdirectory examples' ), $hostname ); ?></td>
                    
                
custom-header.php https://github.com/muskmelon/Greemo.git | PHP | 791 lines
                    
385		pickColor('#<?php echo $color; ?>');
                    
386		<?php } ?>
                    
387
                    
413		var xinit = <?php echo HEADER_IMAGE_WIDTH; ?>;
                    
414		var yinit = <?php echo HEADER_IMAGE_HEIGHT; ?>;
                    
415		var ratio = xinit / yinit;
                    
473</div>
                    
474<?php } ?>
                    
475
                    
486	?>
                    
487	<div id="headimg" style="max-width:<?php echo HEADER_IMAGE_WIDTH; ?>px;height:<?php echo HEADER_IMAGE_HEIGHT; ?>px;background-image:url(<?php esc_url ( header_image() ) ?>);">
                    
488		<?php
                    
493		?>
                    
494		<h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php bloginfo('url'); ?>"><?php bloginfo( 'name' ); ?></a></h1>
                    
495		<div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
                    
                
wp-signup.php https://github.com/muskmelon/Greemo.git | PHP | 455 lines
                    
104            <label class="checkbox" for="blog_public_on">
                    
105                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
                    
106                <strong><?php _e( 'Yes' ); ?></strong>
                    
108            <label class="checkbox" for="blog_public_off">
                    
109                <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
                    
110                <strong><?php _e( 'No' ); ?></strong>
                    
140	<?php } ?>
                    
141	<input name="user_email" type="text" 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.)') ?>
                    
142	<?php
                    
192		<?php show_blog_form($blogname, $blog_title, $errors); ?>
                    
193		<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ) ?>" /></p>
                    
194	</form>
                    
224	<p>
                    
225		<?php printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site.  <a href="%3$s">Log in</a> as &#8220;%4$s&#8221; using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name ) ?>
                    
226	</p>
                    
                
wp-login.php https://github.com/muskmelon/Greemo.git | PHP | 698 lines
                    
61<head>
                    
62	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
                    
63	<title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
                    
86<?php   if ( !is_multisite() ) { ?>
                    
87<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', esc_attr__('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>
                    
88<?php   } else { ?>
                    
88<?php   } else { ?>
                    
89<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', network_home_url() ); ?>" title="<?php echo apply_filters('login_headertitle', esc_attr($current_site->site_name) ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1>
                    
90<?php   }
                    
126	?>
                    
127	<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php esc_attr_e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
                    
128	</div>
                    
356	if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )
                    
357		$_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
                    
358
                    
                
wp-app.php https://github.com/muskmelon/Greemo.git | PHP | 1611 lines
                    
1<?php
                    
2/**
                    
15/** Set up WordPress environment */
                    
16require_once('./wp-load.php');
                    
17
                    
18/** Atom Publishing Protocol Class */
                    
19require_once(ABSPATH . WPINC . '/atomlib.php');
                    
20
                    
21/** Admin Image API for metadata updating */
                    
22require_once(ABSPATH . '/wp-admin/includes/image.php');
                    
23
                    
23
                    
24$_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] );
                    
25
                    
286		if ( !get_option( 'enable_app' ) )
                    
287			$this->forbidden( sprintf( __( 'AtomPub services are disabled on this site.  An admin user can enable them at %s' ), admin_url('options-writing.php') ) );
                    
288
                    
                
AvisotaUpdate.php https://github.com/avisota/contao-core.git | PHP | 1052 lines
                    
1<?php
                    
2
                    
6 *
                    
7 * PHP version 5
                    
8 *
                    
67		foreach (self::$updates as $version => $updates) {
                    
68			$methodName = 'check' . preg_replace('#[^\w]#', '_', $version);
                    
69			if ($this->$methodName()) {
                    
87			if ($this->Input->post('dbupdate')) {
                    
88				$this->redirect('contao/main.php?do=repository_manager&update=database');
                    
89			}
                    
154		foreach (self::$updates as $version => $updates) {
                    
155			$methodName              = 'check' . preg_replace('#[^\w]#', '_', $version);
                    
156			$statuses[$version] = $this->$methodName();
                    
157
                    
158			$shortVersion               = preg_replace('#^(\d+\.\d+\.\d+).*$#', '$1', $version);
                    
159			$versions[$shortVersion] = (isset($versions[$shortVersion]) ? $versions[$shortVersion]
                    
                
class-wp.php https://github.com/sharpmachine/wakeupmedia.com.git | PHP | 620 lines
                    
1<?php
                    
2/**
                    
149			$req_uri = $req_uri_array[0];
                    
150			$self = $_SERVER['PHP_SELF'];
                    
151			$home_path = parse_url(home_url());
                    
163			$req_uri = trim($req_uri, '/');
                    
164			$req_uri = preg_replace("|^$home_path|", '', $req_uri);
                    
165			$req_uri = trim($req_uri, '/');
                    
166			$pathinfo = trim($pathinfo, '/');
                    
167			$pathinfo = preg_replace("|^$home_path|", '', $pathinfo);
                    
168			$pathinfo = trim($pathinfo, '/');
                    
169			$self = trim($self, '/');
                    
170			$self = preg_replace("|^$home_path|", '', $self);
                    
171			$self = trim($self, '/');
                    
194				}
                    
195			} else if ( $req_uri != 'wp-app.php' ) {
                    
196				foreach ( (array) $rewrite as $match => $query ) {
                    
                
MinifyAdmin.php https://github.com/sharpmachine/wakeupmedia.com.git | PHP | 727 lines
                    
1<?php
                    
2
                    
9
                    
10require_once W3TC_INC_DIR . '/functions/rule.php';
                    
11require_once W3TC_LIB_W3_DIR . '/Plugin.php';
                    
20    function activate() {
                    
21        require_once W3TC_INC_DIR . '/functions/activation.php';
                    
22
                    
26
                    
27        $file_index = W3TC_CONTENT_MINIFY_DIR . '/index.php';
                    
28
                    
28
                    
29        if (!@copy(W3TC_INSTALL_MINIFY_DIR . '/index.php', $file_index)) {
                    
30            w3_writable_error($file_index);
                    
59
                    
60        @unlink(W3TC_CONTENT_MINIFY_DIR . '/index.php');
                    
61    }
                    
                
Minify.php https://github.com/sharpmachine/wakeupmedia.com.git | PHP | 1051 lines
                    
1<?php
                    
2
                    
9
                    
10require_once W3TC_LIB_W3_DIR . '/Plugin.php';
                    
11
                    
238                    if ($head_prepend != '') {
                    
239                        $buffer = preg_replace('~<head(\s+[^<>]+)*>~Ui', '\\0' . $head_prepend, $buffer, 1);
                    
240                    }
                    
242                    if ($body_prepend != '') {
                    
243                        $buffer = preg_replace('~<body(\s+[^<>]+)*>~Ui', '\\0' . $body_prepend, $buffer, 1);
                    
244                    }
                    
246                    if ($body_append != '') {
                    
247                        $buffer = preg_replace('~<\\/body>~', $body_append . '\\0', $buffer, 1);
                    
248                    }
                    
277    function get_files_js(&$buffer) {
                    
278        require_once W3TC_INC_DIR . '/functions/extract.php';
                    
279
                    
                
 

Source

Language