100+ results for 'php strlen'
Not the results you expected?
voucher.php (https://bitbucket.org/allanxyh/uniquemall.git) PHP · 263 lines
1 <?php
2 class ControllerAccountVoucher extends Controller {
3 private $error = array();
227 public function validate() {
228 if ((utf8_strlen($this->request->post['to_name']) < 1) || (utf8_strlen($this->request->post['to_name']) > 64)) {
229 $this->error['to_name'] = $this->language->get('error_to_name');
230 }
232 if ((utf8_strlen($this->request->post['to_email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['to_email'])) {
233 $this->error['to_email'] = $this->language->get('error_email');
234 }
236 if ((utf8_strlen($this->request->post['from_name']) < 1) || (utf8_strlen($this->request->post['from_name']) > 64)) {
237 $this->error['from_name'] = $this->language->get('error_from_name');
238 }
shipping.php (https://gitlab.com/shapcy/opencart) PHP · 268 lines
34 }
36 if ((utf8_strlen(trim($this->request->post['firstname'])) < 1) || (utf8_strlen(trim($this->request->post['firstname'])) > 32)) {
37 $json['error']['firstname'] = $this->language->get('error_firstname');
38 }
40 if ((utf8_strlen(trim($this->request->post['lastname'])) < 1) || (utf8_strlen(trim($this->request->post['lastname'])) > 32)) {
41 $json['error']['lastname'] = $this->language->get('error_lastname');
42 }
44 if ((utf8_strlen(trim($this->request->post['address_1'])) < 3) || (utf8_strlen(trim($this->request->post['address_1'])) > 128)) {
45 $json['error']['address_1'] = $this->language->get('error_address_1');
46 }
edit.php (https://github.com/sansanwawa/e-commerse.git) PHP · 337 lines
262 private function validate() {
263 if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) {
264 $this->error['firstname'] = $this->language->get('error_firstname');
265 }
267 if ((strlen(utf8_decode($this->request->post['lastname'])) < 1) || (strlen(utf8_decode($this->request->post['lastname'])) > 32)) {
268 $this->error['lastname'] = $this->language->get('error_lastname');
269 }
277 }
279 if ((strlen(utf8_decode($this->request->post['telephone'])) < 3) || (strlen(utf8_decode($this->request->post['telephone'])) > 32)) {
280 $this->error['telephone'] = $this->language->get('error_telephone');
281 }
zone.php (https://gitlab.com/hazelnuts23/unitedfoodstuff) PHP · 428 lines
voucher.php (https://bitbucket.org/jojoluzifer/gold-light-project.git) PHP · 263 lines
1 <?php
2 class ControllerAccountVoucher extends Controller {
3 private $error = array();
227 protected function validate() {
228 if ((utf8_strlen($this->request->post['to_name']) < 1) || (utf8_strlen($this->request->post['to_name']) > 64)) {
229 $this->error['to_name'] = $this->language->get('error_to_name');
230 }
232 if ((utf8_strlen($this->request->post['to_email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['to_email'])) {
233 $this->error['to_email'] = $this->language->get('error_email');
234 }
236 if ((utf8_strlen($this->request->post['from_name']) < 1) || (utf8_strlen($this->request->post['from_name']) > 64)) {
237 $this->error['from_name'] = $this->language->get('error_from_name');
238 }
registry.php (https://github.com/elinw/joomla-cms.git) PHP · 476 lines
1 <?php
2 /**
3 * @package Joomla.Platform
89 *
90 * @since 12.2
91 * @note The interface is only present in PHP 5.4 and up.
92 */
93 public function jsonSerialize()
344 * Finally, re-key the array so it is sequential.
345 */
346 $nodes = array_values(array_filter(explode('.', $path), 'strlen'));
348 if ($nodes)
ezisbn10to13converter.php (https://bitbucket.org/ericsagnes/ezpublish-multisite.git) PHP · 355 lines
1 <?php
2 /**
3 * File containing the eZISBN10To13Converter class.
287 // If the length of the number is 10, it is an ISBN-10 number and need
288 // to be converted to ISBN-13.
289 if ( strlen( $digits ) == 10 )
290 {
291 $ean = eZISBNType::convertISBN10toISBN13( $digits );
292 }
293 else if ( strlen( $digits ) == 13 )
294 {
295 $ean = $digits;
field_link_color.php (https://gitlab.com/eita/agencia-consumo-responsavel) PHP · 207 lines
sitemailer_.php (https://gitlab.com/nvtdn2006/azora) PHP · 384 lines
1 <?php
2 class SiteMailer
3 {
52 $this->headers .= "MIME-Version: 1.0\r\n";
53 //$this->headers .= "Content-Type: multipart/mixed; boundary=\"PHP-mixed-" . $this->randomHash . "\"\r\n";
54 $this->headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
55 }
89 /*if ($this->attachment != '')
90 {
91 $this->msgBody .= "\r\n--PHP-mixed-" . $this->randomHash . "--";
92 $this->msgBody .= $this->attachment;
93 $this->msgBody .= "\r\n--PHP-mixed-" . $this->randomHash . "--";
156 private function sendActivationToCustomer($property) {
157 /*$htmlCT = "--PHP-alt-" . $this->randomHash . "\r\n";
158 $htmlCT .= 'Content-Type: text/html; charset="iso-8859-1"' . "\r\n";
159 $htmlCT .= 'Content-Transfer-Encoding: 7bit' . "\r\n";*/
Parser.php (https://bitbucket.org/icosplays/friendica.git) PHP · 349 lines
1 <?php
3 /**
9 * @copyright 2006
10 * @license BSD
11 * @version CVS: $Id: Parser.php 322327 2012-01-15 17:55:59Z cweiske $
12 * @link http://pear.php.net/package/Text_LanguageDetect/
114 */
115 public static function validateString($str) {
116 if (!empty($str) && strlen($str) > 3 && preg_match('/\S/', $str)) {
117 return true;
118 } else {
213 function analyze()
214 {
215 $len = strlen($this->_string);
216 $byte_counter = 0;
qrsplit.php (https://gitlab.com/Ltaimao/wecenter) PHP · 311 lines
1 <?php
2 /*
3 * PHP QR Code encoder
8 * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
9 *
10 * PHP QR Code is distributed under LGPL 3
11 * Copyright (C) 2010 Dominik Dzienia <deltalab at poczta dot fm>
12 *
48 public static function isdigitat($str, $pos)
49 {
50 if ($pos >= strlen($str))
51 return false;
198 $p = 1;
199 $dataStrLen = strlen($this->dataStr);
201 while($p < $dataStrLen) {
unicode.php (https://github.com/mcrider/pkpUpgradeTestSuite.git) PHP · 269 lines
1 <?php
2 /**
3 * @version $Id: unicode.php,v 1.1 2008/10/10 20:52:53 mj Exp $
8 * Portions created by the Initial Developer are Copyright (C) 1998
9 * the Initial Developer. All Rights Reserved.
10 * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi)
11 * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com)
12 * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp
13 * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp
14 * @see http://hsivonen.iki.fi/php-utf8/
15 * @package utf8
16 * @subpackage unicode
24 * are not allowed.
25 * Returns false if the input string isn't a valid UTF-8 octet sequence
26 * and raises a PHP error at level E_USER_WARNING
27 * Note: this function has been modified slightly in this library to
28 * trigger errors on encountering bad bytes
zone.php (https://bitbucket.org/sandeepbhaskar/inspiredliving.git) PHP · 441 lines
ResourceTypeConfig.php (https://github.com/muculus/pencms.git) PHP · 357 lines
1 <?php
2 /*
3 * CKFinder
101 }
103 if (!strlen($this->_url)) {
104 $this->_url = "/";
105 }
116 }
118 if (!strlen($this->_directory)) {
119 $this->_directory = resolveUrl($this->_url);
120 }
128 else {
129 $resourceTypeNode["allowedExtensions"] = trim((string)$resourceTypeNode["allowedExtensions"]);
130 if (strlen($resourceTypeNode["allowedExtensions"])) {
131 $extensions = explode(",", $resourceTypeNode["allowedExtensions"]);
132 foreach ($extensions as $e) {
GifCreator.php (https://gitlab.com/billyprice1/mc-skintools) PHP · 349 lines
1 <?php
3 namespace GifCreator;
8 * @link https://github.com/Sybio/GifCreator
9 * @author Sybio (Clément Guillemain / @Sybio01)
10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 * @copyright Clément Guillemain
12 * @modified by Max Korlaar
204 $Locals_str = 13 + 3 * (2 << (ord($this->frameSources[$i]{10}) & 0x07));
206 $Locals_end = strlen($this->frameSources[$i]) - $Locals_str - 1;
207 $Locals_tmp = substr($this->frameSources[$i], $Locals_str, $Locals_end);
235 $Locals_img = substr($Locals_tmp, 8, 10);
236 $Locals_tmp = substr($Locals_tmp, 18, strlen($Locals_tmp) - 18);
238 break;
BodyTest.php (https://gitlab.com/leon0399/damnit-engine) PHP · 401 lines
1 <?php
2 /**
3 * Slim Framework (http://slimframework.com)
4 *
5 * @link https://github.com/slimphp/Slim
6 * @copyright Copyright (c) 2011-2015 Josh Lockhart
7 * @license https://github.com/slimphp/Slim/blob/master/LICENSE.md (MIT License)
12 use Slim\Http\Body;
14 class BodyTest extends \PHPUnit_Framework_TestCase
15 {
16 /**
41 public function resourceFactory($mode = 'r+')
42 {
43 $stream = fopen('php://temp', $mode);
44 fwrite($stream, $this->text);
45 rewind($stream);
class-wp-importer.php (https://gitlab.com/Gashler/dp) PHP · 302 lines
1 <?php
2 /**
3 * WP_Importer base class
160 /**
161 * Sort by strlen, longest string first
162 *
163 * @param string $a
167 function cmpr_strlen( $a, $b ) {
168 return strlen( $b ) - strlen( $a );
169 }
275 $last_arg = $key;
276 } else if ( (bool) preg_match( "/^-([a-zA-Z0-9]+)/", $args[$i], $match ) ) {
277 for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) {
278 $key = $match[1]{$j};
279 $out[$key] = true;
Serializer.php (https://github.com/viggof/moodle.git) PHP · 191 lines
1 <?php
3 class HTMLPurifier_DefinitionCache_Serializer extends
58 if (empty($filename)) continue;
59 if ($filename[0] === '.') continue;
60 $key = substr($filename, 0, strlen($filename) - 4);
61 if ($this->isOld($key, $config)) unlink($dir . '/' . $filename);
62 }
171 $chmod = $chmod | 0070;
172 } else {
173 // PHP's probably running as nobody, so we'll
174 // need to give global permissions
175 $chmod = $chmod | 0777;
report.class.php (https://github.com/easysoft/zentaopms.git) PHP · 542 lines
class-jobtype-dbcheck.php (https://bitbucket.org/cesarmedrano/cesarmedrano.git) PHP · 162 lines
1 <?php
2 /**
3 *
33 public function edit_tab( $jobid ) {
34 ?>
35 <h3 class="title"><?php _e( 'Settings for database check', 'backwpup' ) ?></h3>
36 <p></p>
37 <table class="form-table">
38 <tr valign="top">
39 <th scope="row"><?php _e( 'WordPress tables only', 'backwpup' ); ?></th>
40 <td>
41 <label for="iddbcheckwponly">
42 <input class="checkbox" value="1" id="iddbcheckwponly"
43 type="checkbox" <?php checked( BackWPup_Option::get( $jobid, 'dbcheckwponly' ), TRUE ); ?>
44 name="dbcheckwponly"/> <?php _e( 'Check WordPress database tables only', 'backwpup' ); ?>
Socket.php (https://github.com/markn86/moodle.git) PHP · 222 lines
smarty_internal_parsetree.php (https://github.com/greevex/mzz-framework-blank-application.git) PHP · 236 lines
106 $more_php = $subtree->assign_to_var();
107 } else {
108 $more_php = $subtree->to_smarty_php();
109 }
179 $subtree = $this->subtrees[$key]->to_smarty_php();
180 if (substr($subtree, 0, 1) == '>') {
181 $code = substr($code, 0, strlen($code)-1) . '%<?php ?>>' . substr($subtree, 1);
182 } else {
183 $code .= $subtree;
188 $subtree = $this->subtrees[$key]->to_smarty_php();
189 if (substr($subtree, 0, 1) == '>') {
190 $code = substr($code, 0, strlen($code)-1) . '?<?php ?>>' . substr($subtree, 1);
191 } else {
192 $code .= $subtree;
stylies.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 347 lines
1 <?php
2 defined('JPATH_BASE') or die();
37 if($posStyle === false){
38 } else {
39 $layoutStyle = substr(trim($item),$posStyle+(int)strlen('layout_style='));
40 }
41 }
124 var jvMaju = $$('.jv_slide_stylemaju');
125 var jvStyle7 = $$('.jv_slide_style7');
126 var layout = "<?php echo $layoutStyle; ?>";
127 var selectStyle = function(style){
128 switch(style){
342 });
343 </script>
344 <?php
345 return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', $class, 'value', 'text', $value, $control_name.$name);
346 }
table.php (https://github.com/sjorz/property-exporter.git) PHP · 352 lines
1 <?php
2 //**********************************************************************
3 //
14 //**********************************************************************
16 require_once "odbc-connection.php";
17 require_once "log.php";
160 }
161 $sql .= ' from ' . $this->tableName;
162 if (strlen ($this->sortColumn) > 0)
163 $sql .= ' order by ' . $this->sortColumn;
164 return $this->executeSQL ($sql);
177 }
178 $sql .= ' from ' . $this->tableName;
179 if (strlen ($this->sortColumn) > 0)
180 $sql .= ' group by ' . $this->sortColumn;
181 return $this->executeSQL ($sql);
DocBlockScanner.php (https://github.com/bruisedlee/zf2.git) PHP · 375 lines
1 <?php
3 namespace Zend\Code\Scanner;
231 };
232 $MACRO_STREAM_ADVANCE_WORD = function () use (&$currentWord, &$MACRO_STREAM_ADVANCE_CHAR) {
233 return $MACRO_STREAM_ADVANCE_CHAR(strlen($currentWord));
234 };
235 $MACRO_STREAM_ADVANCE_LINE = function () use (&$currentLine, &$MACRO_STREAM_ADVANCE_CHAR) {
236 return $MACRO_STREAM_ADVANCE_CHAR(strlen($currentLine));
237 };
238 $MACRO_TOKEN_ADVANCE = function () use (&$tokenIndex, &$tokens) {
PropelSQLParser.php (https://github.com/esimionato/Propel2.git) PHP · 241 lines
mxml-search.c (https://gitlab.com/pine64-android/linux-3.10) C · 280 lines
crypto.c (https://github.com/buber82/htc-kernel-msm7227-exp.git) C · 409 lines
smarty_internal_cacheresource_file.php (https://github.com/SquattingSasquatches/Lucidity.git) PHP · 264 lines
1 <?php
2 /**
3 * Smarty Internal Plugin CacheResource File
61 $cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
62 }
63 $cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
64 $cached->timestamp = @filemtime($cached->filepath);
65 $cached->exists = !!$cached->timestamp;
137 $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
138 $_dir = $smarty->getCacheDir();
139 $_dir_length = strlen($_dir);
140 if (isset($_cache_id)) {
141 $_cache_id_parts = explode('|', $_cache_id);
228 public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
229 {
230 if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
231 clearstatcache(true, $cached->lock_id);
232 } else {
FunctionCallSignatureSniff.php (https://github.com/dextercowley/joomla-cms.git) PHP · 257 lines
25 * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
26 * @version Release: 1.3.0RC2
27 * @link http://pear.php.net/package/PHP_CodeSniffer
28 */
29 class Joomla_Sniffs_Functions_FunctionCallSignatureSniff implements PHP_CodeSniffer_Sniff
148 * Processes multi-line calls.
149 *
150 * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
151 * @param int $stackPtr The position of the current token
152 * in the stack passed in $tokens.
158 * @return void
159 */
160 public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens)
161 {
162 // We need to work out how far indented the function
ezsysinfo.php (https://github.com/GunioRobot/ezpublish.git) PHP · 325 lines
1 <?php
2 /**
3 * File containing the eZSysInfo class.
11 /*!
12 \class eZSysInfo ezsysinfo.php
13 \brief Provides common information on the running system
212 if ( substr( $line, 0, 7 ) == 'cpu MHz' )
213 {
214 $cpu = trim( substr( $line, 11, strlen( $line ) - 11 ) );
215 $this->CPUSpeed = $cpu;
216 $this->CPUUnit = 'MHz';
218 if ( substr( $line, 0, 10 ) == 'model name' )
219 {
220 $system = trim( substr( $line, 13, strlen( $line ) - 13 ) );
221 $this->CPUType = $system;
222 }
ezmark.php (https://github.com/GunioRobot/ezpublish.git) PHP · 301 lines
1 #!/usr/bin/env php
2 <?php
74 $arg = $argv[$i];
75 if ( $readOptions and
76 strlen( $arg ) > 0 and
77 $arg[0] == '-' )
78 {
79 if ( strlen( $arg ) > 1 and
80 $arg[1] == '-' )
81 {
130 if ( in_array( $flag, $optionsWithData ) )
131 {
132 if ( strlen( $arg ) > 2 )
133 {
134 $optionData = substr( $arg, 2 );
smarty_internal_cacheresource_file.php (https://github.com/GuessWho/don-t-enter.git) PHP · 259 lines
1 <?php
2 /**
3 * Smarty Internal Plugin CacheResource File
61 $cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
62 }
63 $cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
64 Smarty::muteExpectedErrors();
65 $cached->timestamp = @filemtime($cached->filepath);
141 $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
142 $_dir = $smarty->getCacheDir();
143 $_dir_length = strlen($_dir);
144 if (isset($_cache_id)) {
145 $_cache_id_parts = explode('|', $_cache_id);
223 public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
224 {
225 if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
226 clearstatcache(true, $cached->lock_id);
227 } else {
return_status.php (https://gitlab.com/reclamare/mao) PHP · 375 lines
1 <?php
2 class ControllerLocalisationReturnStatus extends Controller {
3 private $error = array();
339 foreach ($this->request->post['return_status'] as $language_id => $value) {
340 if ((utf8_strlen($value['name']) < 3) || (utf8_strlen($value['name']) > 32)) {
341 $this->error['name'][$language_id] = $this->language->get('error_name');
342 }
length_class.php (https://bitbucket.org/allanxyh/uniquemall.git) PHP · 412 lines
1 <?php
2 class ControllerLocalisationLengthClass extends Controller {
3 private $error = array();
369 foreach ($this->request->post['length_class_description'] as $language_id => $value) {
370 if ((utf8_strlen($value['title']) < 3) || (utf8_strlen($value['title']) > 32)) {
371 $this->error['title'][$language_id] = $this->language->get('error_title');
372 }
374 if (!$value['unit'] || (utf8_strlen($value['unit']) > 4)) {
375 $this->error['unit'][$language_id] = $this->language->get('error_unit');
376 }
module.audio-video.nsv.php (https://github.com/robertleeplummerjr/bluebox.git) PHP · 224 lines
1 <?php
2 /////////////////////////////////////////////////////////////////
3 /// getID3() by James Heinrich <info@getid3.org> //
8 /////////////////////////////////////////////////////////////////
9 // //
10 // module.audio.nsv.php //
11 // module for analyzing Nullsoft NSV files //
12 // dependencies: NONE //
171 $NSVfheader .= fread($fd, $ThisFileInfo['nsv']['NSVf']['meta_size'] + (4 * $ThisFileInfo['nsv']['NSVf']['TOC_entries_1']) + (4 * $ThisFileInfo['nsv']['NSVf']['TOC_entries_2']));
172 $NSVfheaderlength = strlen($NSVfheader);
173 $ThisFileInfo['nsv']['NSVf']['metadata'] = substr($NSVfheader, $offset, $ThisFileInfo['nsv']['NSVf']['meta_size']);
174 $offset += $ThisFileInfo['nsv']['NSVf']['meta_size'];
weight_class.php (https://gitlab.com/dadangnh/sb1-bon) PHP · 401 lines
1 <?php
2 class ControllerLocalisationWeightClass extends Controller {
3 private $error = array();
367 foreach ($this->request->post['weight_class_description'] as $language_id => $value) {
368 if ((utf8_strlen($value['title']) < 3) || (utf8_strlen($value['title']) > 32)) {
369 $this->error['title'][$language_id] = $this->language->get('error_title');
370 }
372 if (!$value['unit'] || (utf8_strlen($value['unit']) > 4)) {
373 $this->error['unit'][$language_id] = $this->language->get('error_unit');
374 }
MailBox.php (https://bitbucket.org/jhunsinfotech/blue-blues.git) PHP · 222 lines
1 <?php
2 /*********************************************************************************
3 ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
10 ********************************************************************************/
12 require_once('modules/Settings/MailScanner/core/MailScannerInfo.php');
13 require_once('modules/Settings/MailScanner/core/MailRecord.php');
178 if($imapfolders) {
179 foreach($imapfolders as $imapfolder) {
180 $folders[] = substr($imapfolder, strlen($this->_imapurl));
181 }
182 }
PwImageWatermark.php (https://gitlab.com/wuhang2003/phpwind) PHP · 244 lines
1 <?php
2 defined('WEKIT_VERSION') || exit('Forbidden');
7 * the last known user to change this file in the repository <$LastChangedBy: jieyin $>
8 * @author Jianmin Chen <sky_hold@163.com>
9 * @version $Id: PwImageWatermark.php 24724 2013-02-17 10:05:52Z jieyin $
10 * @package lib.image
11 */
145 }
146 } else {
147 if (!$this->text || strlen($this->fontcolor) != 7) {
148 return false;
149 }
CredentialsAbstract.php (https://bitbucket.org/haichau59/manga.git) PHP · 244 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: CredentialsAbstract.php 24594 2012-01-05 21:27:01Z matthew $
20 */
23 * @see Zend_Http_Client
24 */
25 //require_once 'Zend/Http/Client.php';
27 /**
28 * @see Zend_Service_WindowsAzure_Credentials_Exception
29 */
30 //require_once 'Zend/Service/WindowsAzure/Credentials/Exception.php';
32 /**
SpotPage_catsjson.php (https://github.com/NZBtje/spotweb-1.git) PHP · 161 lines
1 <?php
2 class SpotPage_catsjson extends SpotPage_Abs {
3 private $_params;
100 $val = $valTmp[0];
102 if ((strlen($val) != 0) && (strlen($key) != 0)) {
103 # Now determine wether we need to enable the checkbox
104 $isSelected = strpos($compressedCatList, ',cat' . $hcat_key . '_z' . $type_key . '_' . $sclist_key.$key . ',') !== false ? true : false;
Plural.php (https://github.com/MontmereLimited/zf2.git) PHP · 231 lines
acf-meta-functions.php (https://gitlab.com/suporte.spturis/carnaval2015.spturis.com.br) PHP · 384 lines
DeleteComment.php (https://gitlab.com/Blueprint-Marketing/wordpress-unit-tests) PHP · 355 lines
1 <?php
3 /**
4 * Admin ajax functions to be tested
5 */
6 require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
8 /**
70 $_POST['_per_page'] = 100;
71 $_POST['_page'] = 1;
72 $_POST['_url'] = admin_url( 'edit-comments.php' );
74 // Make the request
127 $_POST['_per_page'] = 100;
128 $_POST['_page'] = 1;
129 $_POST['_url'] = admin_url( 'edit-comments.php' );
131 // Make the request
Config.php (https://bitbucket.org/webpolis/liiv.git) PHP · 514 lines
1 <?php
2 /*
3 * CKFinder
21 * Include access control config class
22 */
23 require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/AccessControlConfig.php";
24 /**
25 * Include resource type config class
26 */
27 require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/ResourceTypeConfig.php";
28 /**
29 * Include thumbnails config class
30 */
31 require_once CKFINDER_CONNECTOR_LIB_DIR . "/Core/ThumbnailsConfig.php";
32 /**
33 * Include thumbnails config class
registry.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 470 lines
1 <?php
2 /**
3 * @package Joomla.Platform
89 *
90 * @since 12.2
91 * @note The interface is only present in PHP 5.4 and up.
92 */
93 public function jsonSerialize()
339 * nodes, then re-key the array so it's sequential.
340 */
341 $nodes = array_values(array_filter(explode('.', $path), 'strlen'));
343 if ($nodes)
Stream.php (https://github.com/shevron/zf2.git) PHP · 277 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
186 if ($header instanceof \Zend\Http\Header\ContentLength) {
187 $response->contentLength = (int) $header->getFieldValue();
188 if (strlen($response->content) > $response->contentLength) {
189 throw new Exception\OutOfRangeException(
190 sprintf('Too much content was extracted from the stream (%d instead of %d bytes)',
191 strlen($this->content), $this->contentLength));
192 }
193 break;
257 $this->content .= stream_get_contents($this->stream, $bytes);
258 $this->contentStreamed += strlen($this->content);
260 if ($this->contentLength == $this->contentStreamed) {
ValidatorTypeGuesser.php (https://github.com/Exercise/symfony.git) PHP · 273 lines
1 <?php
3 /*
197 case 'Symfony\Component\Validator\Constraints\Max':
198 return new ValueGuess(strlen((string) $constraint->limit), Guess::LOW_CONFIDENCE);
200 case 'Symfony\Component\Validator\Constraints\Size':
201 return new ValueGuess(strlen((string) $constraint->max), Guess::LOW_CONFIDENCE);
202 }
203 }
227 case 'Symfony\Component\Validator\Constraints\Min':
228 return new ValueGuess(strlen((string) $constraint->limit), Guess::LOW_CONFIDENCE);
230 case 'Symfony\Component\Validator\Constraints\Size':
order_status.php (https://gitlab.com/shapcy/opencart) PHP · 380 lines
1 <?php
2 class ControllerLocalisationOrderStatus extends Controller {
3 private $error = array();
339 foreach ($this->request->post['order_status'] as $language_id => $value) {
340 if ((utf8_strlen($value['name']) < 3) || (utf8_strlen($value['name']) > 32)) {
341 $this->error['name'][$language_id] = $this->language->get('error_name');
342 }
DictionaryLoader.php (https://github.com/Exercise/zf2.git) PHP · 267 lines
1 <?php
2 /**
3 * Zend Framework
71 // $indexTermCount = $tiiFile->readLong();
72 if (PHP_INT_SIZE > 4) {
73 $indexTermCount = ord($data[$pos]) << 56 |
74 ord($data[$pos+1]) << 48 |
166 $pb = 0; $pc = 0;
167 while ($pb < strlen($prevTerm) && $pc < $termPrefixLength) {
168 $charBytes = 1;
169 if ((ord($prevTerm[$pb]) & 0xC0) == 0xC0) {
177 }
179 if ($pb + $charBytes > strlen($data)) {
180 // wrong character
181 break;
unicode.php (https://github.com/fusenigk/mantisbt-1.git) PHP · 269 lines
1 <?php
2 /**
3 * @version $Id: unicode.php,v 1.2 2006/02/26 13:20:44 harryf Exp $
8 * Portions created by the Initial Developer are Copyright (C) 1998
9 * the Initial Developer. All Rights Reserved.
10 * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi)
11 * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com)
12 * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp
13 * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp
14 * @see http://hsivonen.iki.fi/php-utf8/
15 * @package utf8
16 * @subpackage unicode
24 * are not allowed.
25 * Returns false if the input string isn't a valid UTF-8 octet sequence
26 * and raises a PHP error at level E_USER_WARNING
27 * Note: this function has been modified slightly in this library to
28 * trigger errors on encountering bad bytes
step_3.php (https://bitbucket.org/deringer/opencart.git) PHP · 256 lines
1 <?php
2 class ControllerStep3 extends Controller {
3 private $error = array();
9 $this->model_install->mysql($this->request->post);
11 $output = '<?php' . "\n";
12 $output .= '// HTTP' . "\n";
13 $output .= 'define(\'HTTP_SERVER\', \'' . HTTP_OPENCART . '\');' . "\n\n";
241 if (!is_writable(DIR_OPENCART . 'config.php')) {
242 $this->error['warning'] = 'Error: Could not write to config.php please check you have set the correct permissions on: ' . DIR_OPENCART . 'config.php!';
243 }
245 if (!is_writable(DIR_OPENCART . 'admin/config.php')) {
246 $this->error['warning'] = 'Error: Could not write to config.php please check you have set the correct permissions on: ' . DIR_OPENCART . 'admin/config.php!';
247 }
Decoder.php (https://github.com/Optix/ZenTracker.git) PHP · 200 lines
157 $decodedPart = static::decode($part);
158 $ret[] = $decodedPart;
159 $i += strlen(PHP_BitTorrent_Encoder::encode($decodedPart));
160 }
186 $keyPart = substr($dictionary, $i);
187 $key = static::decodeString($keyPart);
188 $keyPartLength = strlen(PHP_BitTorrent_Encoder::encodeString($key));
190 $valuePart = substr($dictionary, ($i + $keyPartLength));
191 $value = static::decode($valuePart);
192 $valuePartLength = strlen(PHP_BitTorrent_Encoder::encode($value));
194 $ret[$key] = $value;
UmlCom.cpp (git://github.com/gregsmirnov/bouml.git) C++ · 690 lines
pnajax.php (https://github.com/intraweb-modules12/iw_main.git) PHP · 188 lines
1 <?php
3 /**
43 $formats = '$jpg$$png$$gif$';
44 $formats = str_replace('$'.$file_extension.'$','',$formats);
45 $len = strlen($formats)-2;
46 $formatsArray = explode('$$',substr($formats,1,$len));
48 //change file name
49 $changed = rename(pnModGetVar('iw_main', 'documentRoot').'/'.pnModGetVar('iw_main', 'usersPictureFolder').'/'.$chid, pnModGetVar('iw_main', 'documentRoot').'/'.pnModGetVar('iw_main', 'usersPictureFolder').'/'.substr($chid,1,strlen($chid)));
50 if($changed){
51 pnModFunc('iw_main', 'user', 'deleteAvatar', array('avatarName' => substr($chid,1,-4),
57 //Change small pictures
58 $chid_s = substr($chid,0,-4).'_s.'.$file_extension;
59 rename(pnModGetVar('iw_main', 'documentRoot').'/'.pnModGetVar('iw_main', 'usersPictureFolder').'/'.$chid_s, pnModGetVar('iw_main', 'documentRoot').'/'.pnModGetVar('iw_main', 'usersPictureFolder').'/'.substr($chid_s,1,strlen($chid_s)));
60 pnModFunc('iw_main', 'user', 'deleteAvatar', array('avatarName' => substr($chid_s,1,-4),
61 'extensions' => $formatsArray));
DictionaryLoader.php (https://github.com/gmimano/newd.git) PHP · 265 lines
1 <?php
2 /**
3 * Zend Framework
59 if ($tiVersion != (int)0xFFFFFFFE /* pre-2.1 format */ &&
60 $tiVersion != (int)0xFFFFFFFD /* 2.1+ format */) {
61 require_once 'Zend/Search/Lucene/Exception.php';
62 throw new Zend_Search_Lucene_Exception('Wrong TermInfoIndexFile file format');
63 }
65 // $indexTermCount = $tiiFile->readLong();
66 if (PHP_INT_SIZE > 4) {
67 $indexTermCount = ord($data[$pos]) << 56 |
68 ord($data[$pos+1]) << 48 |
79 (ord($data[$pos+3]) != 0) ||
80 ((ord($data[$pos+4]) & 0x80) != 0)) {
81 require_once 'Zend/Search/Lucene/Exception.php';
82 throw new Zend_Search_Lucene_Exception('Largest supported segment size (for 32-bit mode) is 2Gb');
83 }
Element.php (https://gitlab.com/oytunistrator/php-bootstrap-form) PHP · 179 lines
1 <?php
2 abstract class Element extends Base {
3 protected $_errors = array();
85 $element = substr($element, 0, -1);
87 if (strlen($value > 0)) {
88 if (!empty($this->_attributes['minlength']) && strlen($value) < $this->_attributes['minlength']) {
90 $valid = false;
91 }
92 if (!empty($this->_attributes['maxlength']) && strlen($value) > $this->_attributes['maxlength']) {
93 $this->_errors[] = $element. " should be not more then {$this->_attributes['maxlength']} characters";
94 $valid = false;
string-data-inl.h (https://gitlab.com/0072016/0072016-PHP.LLC) C Header · 221 lines
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2015 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 */
Session.php (https://bitbucket.org/saifshuvo/zf2.git) PHP · 547 lines
Entry.php (https://github.com/tmccormi/openemr.git) PHP · 245 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
76 public function setItunesBlock($value)
77 {
78 if (! ctype_alpha($value) && strlen($value) > 0) {
79 throw new Writer\Exception\InvalidArgumentException('invalid parameter: "block" may only'
80 . ' contain alphabetic characters');
81 }
83 if ($this->stringWrapper->strlen($value) > 255) {
84 throw new Writer\Exception\InvalidArgumentException('invalid parameter: "block" may only'
85 . ' contain a maximum of 255 characters');
111 public function addItunesAuthor($value)
112 {
113 if ($this->stringWrapper->strlen($value) > 255) {
114 throw new Writer\Exception\InvalidArgumentException('invalid parameter: any "author" may only'
115 . ' contain a maximum of 255 characters each');
register.php (https://bitbucket.org/mjalajel/opencart.git) PHP · 242 lines
132 $this->load->model('account/customer');
134 if ((utf8_strlen($this->request->post['firstname']) < 1) || (utf8_strlen($this->request->post['firstname']) > 32)) {
135 $json['error']['firstname'] = $this->language->get('error_firstname');
136 }
138 if ((utf8_strlen($this->request->post['lastname']) < 1) || (utf8_strlen($this->request->post['lastname']) > 32)) {
139 $json['error']['lastname'] = $this->language->get('error_lastname');
140 }
148 }
150 if ((utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {
151 $json['error']['telephone'] = $this->language->get('error_telephone');
152 }
ObjectOperatorIndentSniff.php (https://gitlab.com/link233/bootmw) PHP · 193 lines
11 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
12 * @link http://pear.php.net/package/PHP_CodeSniffer
13 */
25 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
26 * @version Release: @package_version@
27 * @link http://pear.php.net/package/PHP_CodeSniffer
28 */
29 class PEAR_Sniffs_WhiteSpace_ObjectOperatorIndentSniff implements PHP_CodeSniffer_Sniff
53 * Processes this test, when one of its tokens is encountered.
54 *
55 * @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document.
56 * @param int $stackPtr The position of the current token
57 * in the stack passed in $tokens.
59 * @return void
60 */
61 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
62 {
63 $tokens = $phpcsFile->getTokens();
lex_aux.cc (https://gitlab.com/generic-library/festival) C++ · 194 lines
Rscf.php (https://gitlab.com/endomorphosis/jeffersonsmithmayor) PHP · 359 lines
DocBlockScanner.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 326 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
211 };
212 $MACRO_STREAM_ADVANCE_WORD = function () use (&$currentWord, &$MACRO_STREAM_ADVANCE_CHAR) {
213 return $MACRO_STREAM_ADVANCE_CHAR(strlen($currentWord));
214 };
215 $MACRO_STREAM_ADVANCE_LINE = function () use (&$currentLine, &$MACRO_STREAM_ADVANCE_CHAR) {
216 return $MACRO_STREAM_ADVANCE_CHAR(strlen($currentLine));
217 };
218 $MACRO_TOKEN_ADVANCE = function () use (&$tokenIndex, &$tokens) {
StaticValidatorTest.php (https://github.com/adaykin/zf2.git) PHP · 187 lines
1 <?php
2 /**
3 * Zend Framework
39 * @group Zend_Validator
40 */
41 class StaticValidatorTest extends \PHPUnit_Framework_TestCase
42 {
43 public function clearRegistry()
71 /**
72 * Ignores a raised PHP error when in effect, but throws a flag to indicate an error occurred
73 *
74 * @param integer $errno
144 $this->assertFalse($valid->isValid(24));
145 $message = current($valid->getMessages());
146 $this->assertTrue(strlen($message) <= 5);
147 }
Tokenizer.php (https://github.com/jfilip/moodle.git) PHP · 331 lines
1 <?php
3 /*
4 * This file is part of Mustache.php.
5 *
6 * (c) 2010-2014 Justin Hileman
112 }
114 $len = strlen($text);
115 for ($i = 0; $i < $len; $i++) {
116 switch ($this->state) {
241 private function flushBuffer()
242 {
243 if (strlen($this->buffer) > 0) {
244 $this->tokens[] = array(
245 self::TYPE => self::T_TEXT,
Parser.php (https://bitbucket.org/kudutest1/moodlegit.git) PHP · 362 lines
1 <?php
2 /**
3 * SimplePie
4 *
5 * A PHP-Based RSS and Atom Feed Framework.
6 * Takes the hard work out of managing a complete RSS/Atom solution.
7 *
40 * @author Ryan McCue
41 * @link http://simplepie.org/ SimplePie
42 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
43 */
94 /**
95 * Input data length (to avoid calling strlen() everytime this is needed)
96 *
97 * @access private
radio.php (https://github.com/jarednipper/HSU-common-code.git) PHP · 244 lines
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
4 // | PHP version 4.0 |
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
Wsvalidate.php (https://github.com/dstockto/joind.in.git) PHP · 288 lines
1 <?php
2 /**
3 * Joindin validation class
4 *
5 * PHP version 5
6 *
7 * @category Joind.in
16 * Joindin validation class
17 *
18 * PHP version 5
19 *
20 * @category Joind.in
142 //return (!empty($str)) ? true : false; <-- used this but "false" tripped it
143 return (strlen($str) > 0) ? true : false;
144 }
contact.modul.php (https://github.com/pschichtel/Infected-CMS.git) PHP · 302 lines
1 <?php
2 realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME']) and die('<strong>Access denied!</strong>');
3 if (!user::loggedIn())
24 $msg .= ' - ' . $lang->err_name . '<br />';
25 }
26 elseif (mb_strlen(trim($_POST['name']), 'UTF-8') > 70)
27 {
28 $msg .= ' - ' . $lang->err_name2long . '<br />';
32 $msg .= ' - ' . $lang->err_email . '<br />';
33 }
34 elseif (mb_strlen(trim($_POST['email']), 'UTF-8') > 100)
35 {
36 $msg .= ' - ' . $lang->err_email2long . '<br />';
81 $msg .= ' - ' . $lang->err_name . '<br />';
82 }
83 elseif (mb_strlen(trim($_POST['name']), 'UTF-8') > 70)
84 {
85 $msg .= ' - ' . $lang->err_name2long . '<br />';
class-wp-http-cookie.php (https://gitlab.com/VTTE/sitios-vtte) PHP · 261 lines
1 <?php
2 /**
3 * HTTP API: WP_Http_Cookie class
188 // Host - very basic check that the request URL ends with the domain restriction (minus leading dot).
189 $domain = substr( $domain, 0, 1 ) == '.' ? substr( $domain, 1 ) : $domain;
190 if ( substr( $url['host'], -strlen( $domain ) ) != $domain ) {
191 return false;
192 }
199 // Path - request path must start with path restriction.
200 if ( substr( $url['path'], 0, strlen( $path ) ) != $path ) {
201 return false;
202 }
212 * @return string Header encoded cookie name and value.
213 */
214 public function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
215 if ( ! isset( $this->name ) || ! isset( $this->value ) ) {
216 return '';
component.php (https://gitlab.com/Rad1calDreamer/honey) PHP · 314 lines
22 if ($arParams["ADMIN_SECTION"] != "Y")
23 {
24 if (strlen($arParams["SITE_ID"]) <= 0)
25 $arParams["SITE_ID"] = SITE_ID;
26 }
39 $citiesIds = SalesZone::getCitiesIds($arParams["SITE_ID"]);
41 if(count($citiesIds) == 1 && strlen($citiesIds[0]) > 0)
42 {
43 $rsLocationsList = CSaleLocation::GetList(
123 $nameDefault .= ((strlen($arLocDefault["COUNTRY_NAME"])<=0) ? "" : $arLocDefault["COUNTRY_NAME"]);
124 if (strlen($arLocDefault["COUNTRY_NAME"])>0 && strlen($arLocDefault["REGION_NAME"])>0)
125 $nameDefault .= " - ".$arLocDefault["REGION_NAME"];
126 elseif (strlen($arLocDefault["REGION_NAME"])>0)
127 $nameDefault .= $arLocDefault["REGION_NAME"];
129 if ((strlen($arLocDefault["COUNTRY_NAME"])>0 || strlen($arLocDefault["REGION_NAME"])>0) && strlen($arLocDefault["CITY_NAME"])>0)
130 $nameDefault .= " - ".$arLocDefault["CITY_NAME"];
131 elseif (strlen($arLocDefault["CITY_NAME"])>0)
cp_symbol.c (https://gitlab.com/OpenSourceMirror/sourcenav) C · 315 lines
164 entry.key = Symbol->name;
165 entry.key_len = strlen( Symbol->name );
167 if(( pentry = Symtab->ptable->search( &(Symtab->ptable), entry )))
187 entry.key = name;
188 entry.key_len = strlen( name );
190 if(( pentry = Symtab->ptable->search( &(Symtab->ptable), entry )))
293 entry.key = Symbol->name;
294 entry.key_len = strlen( Symbol->name );
295 entry.flag = 0;
rexy_clib.c (https://github.com/nemustech/rexy-embedded.git) C · 427 lines
109 /** Calculates the length of the string s, not including the terminating `\0' character.
110 * Wrapper function for strlen in the standard C library.
111 *
112 * @param s source string pointer
114 * @return the byte length of String s
115 */
116 int RalStrLen(const char *s)
117 {
118 return strlen(s);
ParanoidHTTPFetcher.php (https://gitlab.com/r.collas/site_central) PHP · 242 lines
1 <?php
3 /**
4 * This module contains the CURL-based HTTP fetcher implementation.
5 *
6 * PHP versions 4 and 5
7 *
8 * LICENSE: See the COPYING file included in this distribution.
17 * Interface import
18 */
19 require_once "Auth/Yadis/HTTPFetcher.php";
21 require_once "Auth/OpenID.php";
45 {
46 array_push($this->headers, rtrim($header));
47 return strlen($header);
48 }
Rename.php (https://github.com/eschabell/openshift-zendframework.git) PHP · 304 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Rename.php 23775 2011-03-01 17:25:24Z ralph $
20 */
23 * @see Zend_Filter_Interface
24 */
25 require_once 'Zend/Filter/Interface.php';
27 /**
59 $options = array('target' => $options);
60 } elseif (!is_array($options)) {
61 require_once 'Zend/Filter/Exception.php';
62 throw new Zend_Filter_Exception('Invalid options argument provided to filter');
63 }
DBFieldTest.php (https://gitlab.com/djpmedia/silverstripe-framework) PHP · 262 lines
1 <?php
3 namespace SilverStripe\ORM\Tests;
186 /* BigInt behaviour */
187 $bigInt = DBBigInt::create();
188 $bigInt->setValue(PHP_INT_MAX);
189 $this->assertEquals(PHP_INT_MAX, $bigInt->getValue());
238 foreach ($allFields as $stringField) {
239 $stringField = DBString::create_field($stringField, $value);
240 for ($i = 1; $i < mb_strlen($value); $i++) {
241 $expected = mb_substr($value, 0, $i) . '...';
242 $this->assertEquals($expected, $stringField->LimitCharacters($i));
TarWriter.class.php (https://github.com/KomHunter2/WCF.git) PHP · 274 lines
1 <?php
2 namespace wcf\system\io;
3 use wcf\system\exception\SystemException;
15 * @author Marcel Werk
16 * @copyright 2001-2009 WoltLab GmbH
17 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
18 * @package com.woltlab.wcf
19 * @subpackage system.io
66 $filename = FileUtil::unifyDirSeperator($filename);
68 if (!$this->writeHeaderBlock($filename, strlen($string), TIME_NOW, 33279)) {
69 return false;
70 }
209 */
210 public function writeHeaderBlock($filename, $size, $mtime = 0, $permissions = 0, $typeFlag = '', $uid = 0, $gid = 0) {
211 if (strlen($filename) > 99) {
212 if (!$this->writeLongHeaderBlock($filename)) {
213 return false;
smarty_internal_config.php (https://github.com/raphaelbastide/berta.git) PHP · 270 lines
1 <?php
2 /**
3 * Smarty Internal Plugin Config
59 // get type and name from path
60 list($this->config_resource_type, $this->config_resource_name) = explode(':', $config_resource, 2);
61 if (strlen($this->config_resource_type) == 1) {
62 // 1 char is not resource type, but part of filepath
63 $this->config_resource_type = $this->smarty->default_config_type;
150 $_compile_dir .= DS;
151 }
152 return $_compile_dir . $_filepath . '.' . basename($this->config_resource_name) . '.config' . '.php';
153 }
154 /**
sys_user.php (https://github.com/korczis/Zeus.git) PHP · 142 lines
1 <?php if(!defined('__CP__'))die();
3 define('INPUT_WIDTH', '180px');
28 //Обработка пароля.
29 if(isset($_POST['passold'], $_POST['pass1'], $_POST['pass2']) && strlen($_POST['passold']) > 0 && ($l = strlen($_POST['pass1'])) > 0)
30 {
31 if(strcasecmp(md5($_POST['passold']), $userData['pass']) !== 0)$errors[] = LNG_SYS_PASSWORD_E1;
navigation.php (https://github.com/lzcabrera/cabreramartinez.git) PHP · 227 lines
1 <?php
3 function strstr_after($haystack, $needle, $case_insensitive = false) {
5 $pos = $strpos($haystack, $needle);
6 if (is_int($pos)) {
7 return substr($haystack, $pos + strlen($needle));
8 }
9 // Most likely false or null
114 //page
115 array('title'=>'Confirmación',
116 'url' => '/contactenos/verify.php',
117 'top_nav'=>'false',
118 'left_nav'=>'false',
file.c
(http://omnia2droid.googlecode.com/svn/trunk/)
C · 756 lines
✨ Summary
This C code provides a system for managing kernel objects, such as files and directories, that are used by the Linux kernel’s file system. It allows developers to create, remove, and schedule callbacks for these objects, enabling features like scheduling tasks to run when an object is accessed or modified. The code also handles memory management and synchronization between different parts of the system.
This C code provides a system for managing kernel objects, such as files and directories, that are used by the Linux kernel’s file system. It allows developers to create, remove, and schedule callbacks for these objects, enabling features like scheduling tasks to run when an object is accessed or modified. The code also handles memory management and synchronization between different parts of the system.
Maildir.php (https://github.com/zucchi/zf2.git) PHP · 217 lines
dumper.php (https://github.com/paintitgold/myspace-php-sdk.git) PHP · 360 lines
1 <?php
2 /**
3 * base include file for SimpleTest
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: dumper.php 1723 2008-04-08 00:34:10Z lastcraft $
7 */
8 /**
117 */
118 function clipString($value, $size, $position = 0) {
119 $length = strlen($value);
120 if ($length <= $size) {
121 return $value;
329 return 0;
330 }
331 if (strlen($first) < strlen($second)) {
332 list($first, $second) = array($second, $first);
333 }
FunctionCallSignatureSniff.php (https://github.com/SeanJA/PHP_CodeSniffer-Drupal-Standard.git) PHP · 245 lines
25 * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
26 * @version Release: 1.2.0RC3
27 * @link http://pear.php.net/package/PHP_CodeSniffer
28 */
29 class Drupal_Sniffs_Functions_FunctionCallSignatureSniff implements PHP_CodeSniffer_Sniff
151 * Processes multi-line calls.
152 *
153 * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
154 * @param int $stackPtr The position of the current token
155 * in the stack passed in $tokens.
161 * @return void
162 */
163 public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens)
164 {
165 // We need to work out how far indented the function
ParameterElement.php (https://github.com/timglabisch/pimcore.git) PHP · 334 lines
12 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
13 * @link http://pear.php.net/package/PHP_CodeSniffer
14 */
29 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
30 * @version Release: 1.4.3
31 * @link http://pear.php.net/package/PHP_CodeSniffer
32 */
33 class PHP_CodeSniffer_CommentParser_ParameterElement extends PHP_CodeSniffer_CommentParser_AbstractDocElement
270 $otherVar = (strlen($other->_type) + strlen($other->_varNameWhitespace));
271 $thisVar = (strlen($this->_type) + strlen($this->_varNameWhitespace));
272 if ($otherVar !== $thisVar) {
273 return false;
295 = (strlen($other->_varName) + strlen($other->_commentWhitespace));
296 $thisComment
297 = (strlen($this->_varName) + strlen($this->_commentWhitespace));
299 if ($otherComment !== $thisComment) {
Cache_File.php (https://gitlab.com/karlen/ayo_wp) PHP · 455 lines
1 <?php
2 namespace W3TC;
116 $expires_at = time() + $expire;
117 @fputs( $fp, pack( 'L', $expires_at ) );
118 @fputs( $fp, '<?php exit; ?>' );
119 @fputs( $fp, @serialize( $var ) );
120 @fclose( $fp );
314 $hash = md5( $key );
316 $path = sprintf( '%s/%s/%s.php', substr( $hash, 0, 3 ), substr( $hash, 3, 3 ), $hash );
318 return $path;
409 @fputs( $fp, pack( 'L', $expires_at ) );
410 @fputs( $fp, '<?php exit; ?>' );
411 @fputs( $fp, (int)$value );
412 @fclose( $fp );
API.php (https://github.com/ktk070/Anopier.git) PHP · 335 lines
1 <?php
2 class ExtDirect_API {
3 private $_routerUrl = 'router.php';
154 if(
155 $rMethod->isPublic() &&
156 strlen($rMethod->getDocComment()) > 0
157 ) {
158 $doc = $rMethod->getDocComment();
210 $path = $settings['basePath'] . DIRECTORY_SEPARATOR .
211 $settings['subPath'] . DIRECTORY_SEPARATOR .
212 $class . '.php';
213 $path = str_replace('\\\\', '\\', $path);
214 } else {
246 }
248 public function setRouterUrl($routerUrl = 'router.php') {
249 if(isset($routerUrl)) {
250 $this->_routerUrl = $routerUrl;
Rename.php (https://github.com/frhumanes/PLM.git) PHP · 304 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Rename.php 20096 2010-01-06 02:05:09Z bkarwin $
20 */
23 * @see Zend_Filter_Interface
24 */
25 require_once 'Zend/Filter/Interface.php';
27 /**
59 $options = array('target' => $options);
60 } elseif (!is_array($options)) {
61 require_once 'Zend/Filter/Exception.php';
62 throw new Zend_Filter_Exception('Invalid options argument provided to filter');
63 }
ClassNotFoundFatalErrorHandler.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 203 lines
1 <?php
3 /*
31 public function handleError(array $error, FatalErrorException $exception)
32 {
33 $messageLen = strlen($error['message']);
34 $notFoundSuffix = '\' not found';
35 $notFoundSuffixLen = strlen($notFoundSuffix);
44 foreach (array('class', 'interface', 'trait') as $typeName) {
45 $prefix = ucfirst($typeName).' \'';
46 $prefixLen = strlen($prefix);
47 if (0 !== strpos($error['message'], $prefix)) {
48 continue;
145 $classes = array();
146 $filename = $class.'.php';
147 foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
148 if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {
Helper.php (https://gitlab.com/flyhope/Hiblog) PHP · 226 lines
1 <?php
2 /**
3 * Class Minify_HTML_Helper
97 } elseif (0 === strpos($file, '/')
98 || 1 === strpos($file, ':\\')) {
99 $file = substr($file, strlen($_SERVER['DOCUMENT_ROOT']) + 1);
100 }
101 $file = strtr($file, '\\', '/');
116 if ($checkLastModified) {
117 if (! $this->groupsConfigFile) {
118 $this->groupsConfigFile = dirname(dirname(dirname(__DIR__))) . '/groupsConfig.php';
119 }
120 if (is_file($this->groupsConfigFile)) {
218 $bUri = $minRoot . 'b=' . $base . '&f=' . implode(',', $basedPaths);
220 $uri = strlen($uri) < strlen($bUri)
221 ? $uri
222 : $bUri;
SystemPartition.c (https://github.com/Astaelan/SEMOS.git) C · 311 lines
client.cpp
(http://hadesmem.googlecode.com/svn/trunk/)
C++ · 0 lines
✨ Summary
This C++ code creates a client that establishes an SSL/TLS connection to a specified host and port, verifies the server’s certificate, sends a message to the server, receives a response, and prints the reply. It uses the Boost.Asio library for networking and SSL support. The program runs in a loop until it is manually stopped.
This C++ code creates a client that establishes an SSL/TLS connection to a specified host and port, verifies the server’s certificate, sends a message to the server, receives a response, and prints the reply. It uses the Boost.Asio library for networking and SSL support. The program runs in a loop until it is manually stopped.
ccache.c
(https://swig.svn.sourceforge.net/svnroot/swig)
C · 1389 lines
✨ Summary
This C code implements a caching system for compilers and other build tools. It allows users to specify a directory where cached results can be stored, and provides options for managing cache limits, clearing caches, and setting verbosity levels. The program also handles errors and networking issues, such as duping stderr to prevent caching of error messages.
This C code implements a caching system for compilers and other build tools. It allows users to specify a directory where cached results can be stored, and provides options for managing cache limits, clearing caches, and setting verbosity levels. The program also handles errors and networking issues, such as duping stderr to prevent caching of error messages.
string.c
(https://swig.svn.sourceforge.net/svnroot/swig)
C · 132 lines
✨ Summary
This C code implements a string storage system for WAD files, using a hash table to store and retrieve strings efficiently. It provides functions like wad_string_lookup
to find existing strings in the hash table, wad_string_debug
to display debug information about the stored strings, and custom string copy and concatenation functions (wad_strcpy
, wad_strcat
).
This C code implements a string storage system for WAD files, using a hash table to store and retrieve strings efficiently. It provides functions like wad_string_lookup
to find existing strings in the hash table, wad_string_debug
to display debug information about the stored strings, and custom string copy and concatenation functions (wad_strcpy
, wad_strcat
).
f77char.h
(https://freespeech.svn.sourceforge.net/svnroot/freespeech)
C++ Header · 108 lines
✨ Summary
This C++ class, CHARACTER
, is designed to handle strings passed from C++ to FORTRAN 77 and vice versa. It provides methods for zero-termination, padding, and handling string arrays. The class ensures proper memory management and portability across different platforms. It also includes operators for assigning a new string and converting the object to a character pointer.
This C++ class, CHARACTER
, is designed to handle strings passed from C++ to FORTRAN 77 and vice versa. It provides methods for zero-termination, padding, and handling string arrays. The class ensures proper memory management and portability across different platforms. It also includes operators for assigning a new string and converting the object to a character pointer.
48 inline CHARACTER::CHARACTER(char* cstring)
49 : rep(cstring), len(strlen(cstring))
50 {};
54 {
55 // find position from where to start padding
56 size_t slen = strlen(rep); // upper limit
57 size_t actual = (slen < len)? slen : len; // actual <= len.
58 for(size_t i=actual;i<len;i++) rep[i]=' '; // Do the padding.
87 for(size_t index=first; index<=stop; index++) {
88 pos = index*len;
89 size_t slen = strlen(rep+pos); // upper limit
90 size_t actual = (slen < len)? slen : len;
91 for(i=pos+actual;i<pos+len;i++) rep[i]=' '; // Do the padding.
UnixFileSystem.php (git://github.com/alexgorbatchev/SyntaxHighlighter.git) text · 0 lines
1 <?php
2 /*
3 * $Id: UnixFileSystem.php 258 2007-10-21 00:46:45Z hans $
20 */
22 include_once 'phing/system/io/FileSystem.php';
24 /**
25 * UnixFileSystem class. This class encapsulates the basic file system functions
26 * for platforms using the unix (posix)-stylish filesystem. It wraps php native
27 * functions suppressing normal PHP error reporting and instead uses Exception
29 *
30 * This class is part of a oop based filesystem abstraction and targeted to run
31 * on all supported php platforms.
32 *
33 * Note: For debugging turn track_errors on in the php.ini. The error messages
cache.c
(http://omnia2droid.googlecode.com/svn/trunk/)
C · 416 lines
✨ Summary
This C code implements a caching system for file systems, known as FS-Cache. It allows multiple file systems to share cached data and reduces I/O operations by storing frequently accessed files in memory. The code provides functions to add, remove, and manage caches, as well as handle errors and withdraw caches from service.
This C code implements a caching system for file systems, known as FS-Cache. It allows multiple file systems to share cached data and reduces I/O operations by storing frequently accessed files in memory. The code provides functions to add, remove, and manage caches, as well as handle errors and withdraw caches from service.
ws_accessService.cpp
(git://github.com/hpcc-systems/HPCC-Platform.git)
C++ · 4715 lines
✨ Summary
This C++ code is part of a web application that handles security-related functionality. It provides methods for checking if authentication is enabled, handling Firefox compatibility issues, and generating HTML responses for error messages. The code uses exception handling to catch and forward errors, ensuring the application remains stable and functional.
This C++ code is part of a web application that handles security-related functionality. It provides methods for checking if authentication is enabled, handling Firefox compatibility issues, and generating HTML responses for error messages. The code uses exception handling to catch and forward errors, ensuring the application remains stable and functional.
379 const char* comma = strchr(basedn, ',');
380 const char* eqsign = strchr(basedn, '=');
381 if(eqsign && comma && (strlen(comma) > 1))
382 {
383 basednBuf.clear().append(comma + 1);
933 CLdapSecManager* secmgr0 = (CLdapSecManager*)secmgr;
934 if((secmgr0->getLdapServerType() == ACTIVE_DIRECTORY) && (strlen(username) > 20))
935 {
936 resp.setRetcode(-1);
Logger.cpp
(http://hadesmem.googlecode.com/svn/trunk/)
C++ · 112 lines
✨ Summary
This C++ code defines a logging system with two classes: Logger
and FileLogger
. The Logger
class provides a basic logging functionality, while the FileLogger
class is a specialization that logs to a file. Both classes have methods for enabling/disabling logging and logging formatted strings. They are part of an AsmJit library, which appears to be a complete JIT (Just-In-Time) assembler for C++.
This C++ code defines a logging system with two classes: Logger
and FileLogger
. The Logger
class provides a basic logging functionality, while the FileLogger
class is a specialization that logs to a file. Both classes have methods for enabling/disabling logging and logging formatted strings. They are part of an AsmJit library, which appears to be a complete JIT (Just-In-Time) assembler for C++.
MultiPage.cpp
(https://bitbucket.org/cabalistic/ogredeps/)
C++ · 975 lines
✨ Summary
This C++ code implements a memory-based bitmap image processing library, FreeImage. It provides functions for loading and saving bitmaps from/to memory, as well as managing multiple pages of data within a single bitmap. The library uses a cache to store modified data and allows for locking and moving pages between different parts of the bitmap.
This C++ code implements a memory-based bitmap image processing library, FreeImage. It provides functions for loading and saving bitmaps from/to memory, as well as managing multiple pages of data within a single bitmap. The library uses a cache to store modified data and allows for locking and moving pages between different parts of the bitmap.
dhd_common.c
(http://omnia2droid.googlecode.com/svn/trunk/)
C · 1733 lines
✨ Summary
This C code snippet appears to be part of a wireless networking driver, specifically related to Wi-Fi scanning and management. It provides functions for requesting Wi-Fi scans, deleting BSS (Basic Service Set) entries, and retrieving partial scan results. The code also handles various error conditions and manages internal data structures, such as the iscan_chain
buffer.
This C code snippet appears to be part of a wireless networking driver, specifically related to Wi-Fi scanning and management. It provides functions for requesting Wi-Fi scans, deleting BSS (Basic Service Set) entries, and retrieving partial scan results. The code also handles various error conditions and manages internal data structures, such as the iscan_chain
buffer.
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
110 {"msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0 },
111 #endif /* DHD_DEBUG */
112 {"bcmerrorstr", IOV_BCMERRORSTR, 0, IOVT_BUFFER, BCME_STRLEN },
113 {"bcmerror", IOV_BCMERROR, 0, IOVT_INT8, 0 },
114 {"wdtick", IOV_WDTICK, 0, IOVT_UINT32, 0 },
233 case IOV_GVAL(IOV_BCMERRORSTR):
234 strncpy((char *)arg, bcmerrorstr(dhd_pub->bcmerror), BCME_STRLEN);
235 ((char *)arg)[BCME_STRLEN - 1] = 0x00;
981 }
982 src = src + 2; /* Skip past 0x */
983 if (strlen(src) % 2 != 0) {
984 DHD_ERROR(("Mask invalid format. Needs to be of even length\n"));
985 return -1;
ezhttpheader.php
(git://github.com/ezsystems/ezpublish.git)
PHP · 158 lines
✨ Summary
The eZHTTPHeader class provides functionality for managing custom HTTP headers in a web application. It checks if custom headers are enabled and returns an array of header overrides based on the requested URI, taking into account settings such as header list, depth, and level. The class also handles cases where content/view is used in the URL alias.
The eZHTTPHeader class provides functionality for managing custom HTTP headers in a web application. It checks if custom headers are enabled and returns an array of header overrides based on the requested URI, taking into account settings such as header list, depth, and level. The class also handles cases where content/view is used in the URL alias.
1 <?php
2 /**
3 * File containing the eZHTTPHeader class.
11 /*!
12 \class eZHTTPHeader ezhttpheader.php
13 \brief The class eZHTTPHeader does
105 {
106 $path = '/' . eZURLAliasML::cleanURL( $path );
107 if ( strlen( $path ) == 1 &&
108 ( !$contentView && ( $ini->variable( 'HTTPHeaderSettings', 'OnlyForContent' ) === 'enabled' ) ) &&
109 $uriString != '/' )