@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | { |
62 | 62 | // Fix for bug #10799: add 'D' modifier to regex |
63 | 63 | if (isset($this->_data[$this->name])) { |
64 | - if (!preg_match($this->_data[$this->name] . 'D', $value)) { |
|
64 | + if (!preg_match($this->_data[$this->name].'D', $value)) { |
|
65 | 65 | return false; |
66 | 66 | } |
67 | 67 | } else { |
68 | - if (!preg_match($regex . 'D', $value)) { |
|
68 | + if (!preg_match($regex.'D', $value)) { |
|
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | } |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | |
92 | 92 | // bug #12376, converting unicode escapes and stripping 'u' modifier |
93 | 93 | if ($pos = strpos($regex, 'u', strrpos($regex, '/'))) { |
94 | - $regex = substr($regex, 0, $pos) . substr($regex, $pos + 1); |
|
94 | + $regex = substr($regex, 0, $pos).substr($regex, $pos + 1); |
|
95 | 95 | $regex = preg_replace('/(?<!\\\\)(?>\\\\\\\\)*\\\\x{([a-fA-F0-9]+)}/', '\\u$1', $regex); |
96 | 96 | } |
97 | 97 | |
98 | - return array(" var regex = " . $regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})"); |
|
98 | + return array(" var regex = ".$regex.";\n", "{jsVar} != '' && !regex.test({jsVar})"); |
|
99 | 99 | } // end func getValidationScript |
100 | 100 | |
101 | 101 | } // end class HTML_QuickForm_Rule_Regex |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | if (!empty($attributes['class'])) { |
87 | 87 | $oldClass = $attributes['class']; |
88 | 88 | } |
89 | - $attributes['class'] = $oldClass . ' selectpicker show-tick form-control'; |
|
89 | + $attributes['class'] = $oldClass.' selectpicker show-tick form-control'; |
|
90 | 90 | $attributes['data-live-search'] = 'true'; |
91 | 91 | } |
92 | 92 | $columnsSize = isset($attributes['cols-size']) ? $attributes['cols-size'] : null; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | function getPrivateName() |
197 | 197 | { |
198 | 198 | if ($this->getAttribute('multiple')) { |
199 | - return $this->getName() . '[]'; |
|
199 | + return $this->getName().'[]'; |
|
200 | 200 | } else { |
201 | 201 | return $this->getName(); |
202 | 202 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | function getMultiple() |
314 | 314 | { |
315 | - return (bool)$this->getAttribute('multiple'); |
|
315 | + return (bool) $this->getAttribute('multiple'); |
|
316 | 316 | } //end func getMultiple |
317 | 317 | |
318 | 318 | // }}} |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | function addOption($text, $value, $attributes = null, $return_array = false) |
333 | 333 | { |
334 | 334 | if (null === $attributes) { |
335 | - $attributes = array('value' => (string)$value); |
|
335 | + $attributes = array('value' => (string) $value); |
|
336 | 336 | } else { |
337 | 337 | $attributes = $this->_parseAttributes($attributes); |
338 | 338 | if (isset($attributes['selected'])) { |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $this->_values[] = $value; |
345 | 345 | } |
346 | 346 | } |
347 | - $this->_updateAttrArray($attributes, array('value' => (string)$value)); |
|
347 | + $this->_updateAttrArray($attributes, array('value' => (string) $value)); |
|
348 | 348 | } |
349 | 349 | if ($return_array) { |
350 | 350 | return array('text' => $text, 'attr' => $attributes); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * @return PEAR_Error on error or true |
384 | 384 | * @throws PEAR_Error |
385 | 385 | */ |
386 | - function loadArray($arr, $values=null) |
|
386 | + function loadArray($arr, $values = null) |
|
387 | 387 | { |
388 | 388 | if (!is_array($arr)) { |
389 | 389 | return PEAR::raiseError('Argument 1 of HTML_Select::loadArray is not a valid array'); |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | * @return PEAR_Error on error or true |
421 | 421 | * @throws PEAR_Error |
422 | 422 | */ |
423 | - function loadDbResult(&$result, $textCol=null, $valueCol=null, $values=null) |
|
423 | + function loadDbResult(&$result, $textCol = null, $valueCol = null, $values = null) |
|
424 | 424 | { |
425 | 425 | if (!is_object($result) || !is_a($result, 'db_result')) { |
426 | 426 | return PEAR::raiseError('Argument 1 of HTML_Select::loadDbResult is not a valid DB_result'); |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $this->setValue($values); |
430 | 430 | } |
431 | 431 | $fetchMode = ($textCol && $valueCol) ? DB_FETCHMODE_ASSOC : DB_FETCHMODE_ORDERED; |
432 | - while (is_array($row = $result->fetchRow($fetchMode)) ) { |
|
432 | + while (is_array($row = $result->fetchRow($fetchMode))) { |
|
433 | 433 | if ($fetchMode == DB_FETCHMODE_ASSOC) { |
434 | 434 | $this->addOption($row[$textCol], $row[$valueCol]); |
435 | 435 | } else { |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | * @return void |
456 | 456 | * @throws PEAR_Error |
457 | 457 | */ |
458 | - function loadQuery(&$conn, $sql, $textCol=null, $valueCol=null, $values=null) |
|
458 | + function loadQuery(&$conn, $sql, $textCol = null, $valueCol = null, $values = null) |
|
459 | 459 | { |
460 | 460 | if (is_string($conn)) { |
461 | 461 | require_once('DB.php'); |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * @return PEAR_Error on error or true |
503 | 503 | * @throws PEAR_Error |
504 | 504 | */ |
505 | - function load(&$options, $param1=null, $param2=null, $param3=null, $param4=null) |
|
505 | + function load(&$options, $param1 = null, $param2 = null, $param3 = null, $param4 = null) |
|
506 | 506 | { |
507 | 507 | switch (true) { |
508 | 508 | case is_array($options): |
@@ -539,32 +539,32 @@ discard block |
||
539 | 539 | $strHtml = ''; |
540 | 540 | |
541 | 541 | if ($this->getComment() != '') { |
542 | - $strHtml .= $tabs . '<!-- ' . $this->getComment() . " //-->\n"; |
|
542 | + $strHtml .= $tabs.'<!-- '.$this->getComment()." //-->\n"; |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | if (!$this->getMultiple()) { |
546 | 546 | $attrString = $this->_getAttrString($this->_attributes); |
547 | 547 | } else { |
548 | 548 | $myName = $this->getName(); |
549 | - $this->setName($myName . '[]'); |
|
549 | + $this->setName($myName.'[]'); |
|
550 | 550 | $attrString = $this->_getAttrString($this->_attributes); |
551 | 551 | $this->setName($myName); |
552 | 552 | } |
553 | 553 | |
554 | - $strHtml .= $tabs . '<select ' . $attrString . ">\n"; |
|
554 | + $strHtml .= $tabs.'<select '.$attrString.">\n"; |
|
555 | 555 | |
556 | - $strValues = is_array($this->_values)? array_map('strval', $this->_values): array(); |
|
556 | + $strValues = is_array($this->_values) ? array_map('strval', $this->_values) : array(); |
|
557 | 557 | |
558 | 558 | foreach ($this->_options as $option) { |
559 | 559 | |
560 | 560 | if (!empty($strValues) && in_array($option['attr']['value'], $strValues, true)) { |
561 | 561 | $option['attr']['selected'] = 'selected'; |
562 | 562 | } |
563 | - $strHtml .= $tabs . "<option" . $this->_getAttrString($option['attr']) . '>' . |
|
564 | - $option['text'] . "</option>"; |
|
563 | + $strHtml .= $tabs."<option".$this->_getAttrString($option['attr']).'>'. |
|
564 | + $option['text']."</option>"; |
|
565 | 565 | } |
566 | 566 | foreach ($this->_optgroups as $optgroup) { |
567 | - $strHtml .= $tabs . '<optgroup label="' . $optgroup['label'] . '">'; |
|
567 | + $strHtml .= $tabs.'<optgroup label="'.$optgroup['label'].'">'; |
|
568 | 568 | foreach ($optgroup['options'] as $option) { |
569 | 569 | $text = $option['text']; |
570 | 570 | unset($option['text']); |
@@ -573,11 +573,11 @@ discard block |
||
573 | 573 | $option['selected'] = 'selected'; |
574 | 574 | } |
575 | 575 | |
576 | - $strHtml .= $tabs . " <option" . $this->_getAttrString($option) . '>' .$text . "</option>"; |
|
576 | + $strHtml .= $tabs." <option".$this->_getAttrString($option).'>'.$text."</option>"; |
|
577 | 577 | } |
578 | 578 | $strHtml .= "</optgroup>"; |
579 | 579 | } |
580 | - return $strHtml . $tabs . '</select>'; |
|
580 | + return $strHtml.$tabs.'</select>'; |
|
581 | 581 | } |
582 | 582 | } |
583 | 583 | |
@@ -602,22 +602,22 @@ discard block |
||
602 | 602 | } |
603 | 603 | } |
604 | 604 | } |
605 | - $html = empty($value)? ' ': join('<br />', $value); |
|
605 | + $html = empty($value) ? ' ' : join('<br />', $value); |
|
606 | 606 | if ($this->_persistantFreeze) { |
607 | 607 | $name = $this->getPrivateName(); |
608 | 608 | // Only use id attribute if doing single hidden input |
609 | 609 | if (1 == count($value)) { |
610 | 610 | $id = $this->getAttribute('id'); |
611 | - $idAttr = isset($id)? array('id' => $id): array(); |
|
611 | + $idAttr = isset($id) ? array('id' => $id) : array(); |
|
612 | 612 | } else { |
613 | 613 | $idAttr = array(); |
614 | 614 | } |
615 | 615 | foreach ($value as $key => $item) { |
616 | - $html .= '<input' . $this->_getAttrString(array( |
|
616 | + $html .= '<input'.$this->_getAttrString(array( |
|
617 | 617 | 'type' => 'hidden', |
618 | 618 | 'name' => $name, |
619 | 619 | 'value' => $this->_values[$key] |
620 | - ) + $idAttr) . ' />'; |
|
620 | + ) + $idAttr).' />'; |
|
621 | 621 | } |
622 | 622 | } |
623 | 623 | return $html; |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $value = $this->_findValue($submitValues); |
636 | 636 | if (is_null($value)) { |
637 | 637 | $value = $this->getValue(); |
638 | - } elseif(!is_array($value)) { |
|
638 | + } elseif (!is_array($value)) { |
|
639 | 639 | $value = array($value); |
640 | 640 | } |
641 | 641 | if (is_array($value) && !empty($this->_options)) { |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | */ |
129 | 129 | function HTML_Table_Storage($tabOffset = 0, $useTGroups = false) |
130 | 130 | { |
131 | - parent::__construct(null, (int)$tabOffset); |
|
132 | - $this->_useTGroups = (boolean)$useTGroups; |
|
131 | + parent::__construct(null, (int) $tabOffset); |
|
132 | + $this->_useTGroups = (boolean) $useTGroups; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | function setCellAttributes($row, $col, $attributes) |
290 | 290 | { |
291 | - if ( isset($this->_structure[$row][$col]) |
|
291 | + if (isset($this->_structure[$row][$col]) |
|
292 | 292 | && $this->_structure[$row][$col] == '__SPANNED__' |
293 | 293 | ) { |
294 | 294 | return; |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | function updateCellAttributes($row, $col, $attributes) |
316 | 316 | { |
317 | - if ( isset($this->_structure[$row][$col]) |
|
317 | + if (isset($this->_structure[$row][$col]) |
|
318 | 318 | && $this->_structure[$row][$col] == '__SPANNED__' |
319 | 319 | ) { |
320 | 320 | return; |
@@ -337,13 +337,13 @@ discard block |
||
337 | 337 | */ |
338 | 338 | function getCellAttributes($row, $col) |
339 | 339 | { |
340 | - if ( isset($this->_structure[$row][$col]) |
|
340 | + if (isset($this->_structure[$row][$col]) |
|
341 | 341 | && $this->_structure[$row][$col] != '__SPANNED__' |
342 | 342 | ) { |
343 | 343 | return $this->_structure[$row][$col]['attr']; |
344 | 344 | } elseif (!isset($this->_structure[$row][$col])) { |
345 | - return PEAR::raiseError('Invalid table cell reference[' . |
|
346 | - $row . '][' . $col . '] in HTML_Table::getCellAttributes'); |
|
345 | + return PEAR::raiseError('Invalid table cell reference['. |
|
346 | + $row.']['.$col.'] in HTML_Table::getCellAttributes'); |
|
347 | 347 | } |
348 | 348 | return; |
349 | 349 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | function _setSingleCellContents($row, $col, $contents, $type = 'TD') |
407 | 407 | { |
408 | - if ( isset($this->_structure[$row][$col]) |
|
408 | + if (isset($this->_structure[$row][$col]) |
|
409 | 409 | && $this->_structure[$row][$col] == '__SPANNED__' |
410 | 410 | ) { |
411 | 411 | return; |
@@ -427,14 +427,14 @@ discard block |
||
427 | 427 | */ |
428 | 428 | function getCellContents($row, $col) |
429 | 429 | { |
430 | - if ( isset($this->_structure[$row][$col]) |
|
430 | + if (isset($this->_structure[$row][$col]) |
|
431 | 431 | && $this->_structure[$row][$col] == '__SPANNED__' |
432 | 432 | ) { |
433 | 433 | return; |
434 | 434 | } |
435 | 435 | if (!isset($this->_structure[$row][$col])) { |
436 | - return PEAR::raiseError('Invalid table cell reference[' . |
|
437 | - $row . '][' . $col . '] in HTML_Table::getCellContents'); |
|
436 | + return PEAR::raiseError('Invalid table cell reference['. |
|
437 | + $row.']['.$col.'] in HTML_Table::getCellContents'); |
|
438 | 438 | } |
439 | 439 | return $this->_structure[$row][$col]['contents']; |
440 | 440 | } |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $inTR = false) |
478 | 478 | { |
479 | 479 | if (isset($contents) && !is_array($contents)) { |
480 | - return PEAR::raiseError('First parameter to HTML_Table::addRow ' . |
|
480 | + return PEAR::raiseError('First parameter to HTML_Table::addRow '. |
|
481 | 481 | 'must be an array'); |
482 | 482 | } |
483 | 483 | if (is_null($contents)) { |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | function addCol($contents = null, $attributes = null, $type = 'td') |
621 | 621 | { |
622 | 622 | if (isset($contents) && !is_array($contents)) { |
623 | - return PEAR::raiseError('First parameter to HTML_Table::addCol ' . |
|
623 | + return PEAR::raiseError('First parameter to HTML_Table::addCol '. |
|
624 | 624 | 'must be an array'); |
625 | 625 | } |
626 | 626 | if (is_null($contents)) { |
@@ -727,13 +727,13 @@ discard block |
||
727 | 727 | $extraTab = ''; |
728 | 728 | } |
729 | 729 | if ($this->_cols > 0) { |
730 | - for ($i = 0 ; $i < $this->_rows ; $i++) { |
|
730 | + for ($i = 0; $i < $this->_rows; $i++) { |
|
731 | 731 | $attr = ''; |
732 | 732 | if (isset($this->_structure[$i]['attr'])) { |
733 | 733 | $attr = $this->_getAttrString($this->_structure[$i]['attr']); |
734 | 734 | } |
735 | - $strHtml .= $tabs .$tab . $extraTab . '<tr'.$attr.'>' . $lnEnd; |
|
736 | - for ($j = 0 ; $j < $this->_cols ; $j++) { |
|
735 | + $strHtml .= $tabs.$tab.$extraTab.'<tr'.$attr.'>'.$lnEnd; |
|
736 | + for ($j = 0; $j < $this->_cols; $j++) { |
|
737 | 737 | $attr = ''; |
738 | 738 | $contents = ''; |
739 | 739 | $type = 'td'; |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | if (is_object($contents)) { |
754 | 754 | // changes indent and line end settings on nested tables |
755 | 755 | if (is_subclass_of($contents, 'html_common')) { |
756 | - $contents->setTab($tab . $extraTab); |
|
756 | + $contents->setTab($tab.$extraTab); |
|
757 | 757 | $contents->setTabOffset($this->_tabOffset + 3); |
758 | 758 | $contents->_nestLevel = $this->_nestLevel + 1; |
759 | 759 | $contents->setLineEnd($this->_getLineEnd()); |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | $contents = implode(', ', $contents); |
769 | 769 | } |
770 | 770 | |
771 | - $typeContent = $tabs . $tab . $tab . $extraTab . "<$type" . $this->_getAttrString($attr) . '>'; |
|
771 | + $typeContent = $tabs.$tab.$tab.$extraTab."<$type".$this->_getAttrString($attr).'>'; |
|
772 | 772 | |
773 | 773 | if (empty($contents)) { |
774 | 774 | if (isset($this->_autoFill) && $this->_autoFill) { |
@@ -777,14 +777,14 @@ discard block |
||
777 | 777 | } else { |
778 | 778 | $typeContent .= $contents; |
779 | 779 | } |
780 | - $typeContent .= "</$type>" . $lnEnd; |
|
780 | + $typeContent .= "</$type>".$lnEnd; |
|
781 | 781 | |
782 | 782 | if (!empty($contents)) { |
783 | 783 | $strHtml .= $typeContent; |
784 | 784 | } |
785 | 785 | |
786 | 786 | } |
787 | - $strHtml .= $tabs . $tab . $extraTab . '</tr>' . $lnEnd; |
|
787 | + $strHtml .= $tabs.$tab.$extraTab.'</tr>'.$lnEnd; |
|
788 | 788 | } |
789 | 789 | } |
790 | 790 | return $strHtml; |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | { |
90 | 90 | // Initial Setting for saving |
91 | 91 | $this->_BIG_BLOCK_SIZE = pow(2, |
92 | - ((isset($this->_BIG_BLOCK_SIZE))? $this->_adjust2($this->_BIG_BLOCK_SIZE) : 9)); |
|
93 | - $this->_SMALL_BLOCK_SIZE= pow(2, |
|
94 | - ((isset($this->_SMALL_BLOCK_SIZE))? $this->_adjust2($this->_SMALL_BLOCK_SIZE): 6)); |
|
92 | + ((isset($this->_BIG_BLOCK_SIZE)) ? $this->_adjust2($this->_BIG_BLOCK_SIZE) : 9)); |
|
93 | + $this->_SMALL_BLOCK_SIZE = pow(2, |
|
94 | + ((isset($this->_SMALL_BLOCK_SIZE)) ? $this->_adjust2($this->_SMALL_BLOCK_SIZE) : 6)); |
|
95 | 95 | |
96 | 96 | // Open temp file if we are sending output to stdout |
97 | 97 | if (($filename == '-') || ($filename == '')) { |
98 | 98 | $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root"); |
99 | - $this->_FILEH_ = @fopen($this->_tmp_filename,"w+b"); |
|
99 | + $this->_FILEH_ = @fopen($this->_tmp_filename, "w+b"); |
|
100 | 100 | if ($this->_FILEH_ == false) { |
101 | 101 | return $this->raiseError("Can't create temporary file."); |
102 | 102 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | function _calcSize(&$raList) |
148 | 148 | { |
149 | 149 | // Calculate Basic Setting |
150 | - list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0,0,0); |
|
150 | + list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0, 0, 0); |
|
151 | 151 | $iSmallLen = 0; |
152 | 152 | $iSBcnt = 0; |
153 | 153 | for ($i = 0; $i < count($raList); $i++) { |
@@ -155,21 +155,21 @@ discard block |
||
155 | 155 | $raList[$i]->Size = $raList[$i]->_DataLen(); |
156 | 156 | if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) { |
157 | 157 | $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) |
158 | - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); |
|
158 | + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0); |
|
159 | 159 | } else { |
160 | 160 | $iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + |
161 | - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
161 | + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | } |
165 | 165 | $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; |
166 | 166 | $iSlCnt = floor($this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE); |
167 | - $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0); |
|
168 | - $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + |
|
169 | - (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
167 | + $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt) ? 1 : 0); |
|
168 | + $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + |
|
169 | + (($iSmallLen % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
170 | 170 | $iCnt = count($raList); |
171 | 171 | $iBdCnt = $this->_BIG_BLOCK_SIZE / OLE_PPS_SIZE; |
172 | - $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0)); |
|
172 | + $iPPScnt = (floor($iCnt / $iBdCnt) + (($iCnt % $iBdCnt) ? 1 : 0)); |
|
173 | 173 | |
174 | 174 | return array($iSBDcnt, $iBBcnt, $iPPScnt); |
175 | 175 | } |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | */ |
185 | 185 | function _adjust2($i2) |
186 | 186 | { |
187 | - $iWk = log($i2)/log(2); |
|
188 | - return ($iWk > floor($iWk))? floor($iWk)+1:$iWk; |
|
187 | + $iWk = log($i2) / log(2); |
|
188 | + return ($iWk > floor($iWk)) ? floor($iWk) + 1 : $iWk; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -207,17 +207,17 @@ discard block |
||
207 | 207 | $iBdExL = 0; |
208 | 208 | $iAll = $iBBcnt + $iPPScnt + $iSBDcnt; |
209 | 209 | $iAllW = $iAll; |
210 | - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); |
|
211 | - $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); |
|
210 | + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0); |
|
211 | + $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0); |
|
212 | 212 | |
213 | 213 | // Calculate BD count |
214 | 214 | if ($iBdCnt > $i1stBdL) { |
215 | 215 | while (1) { |
216 | 216 | $iBdExL++; |
217 | 217 | $iAllW++; |
218 | - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); |
|
219 | - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); |
|
220 | - if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) { |
|
218 | + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0); |
|
219 | + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0); |
|
220 | + if ($iBdCnt <= ($iBdExL * $iBlCnt + $i1stBdL)) { |
|
221 | 221 | break; |
222 | 222 | } |
223 | 223 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | . "\x00\x00\x00\x00" |
240 | 240 | . "\x00\x00\x00\x00" |
241 | 241 | . pack("V", $iBdCnt) |
242 | - . pack("V", $iBBcnt+$iSBDcnt) //ROOT START |
|
242 | + . pack("V", $iBBcnt + $iSBDcnt) //ROOT START |
|
243 | 243 | . pack("V", 0) |
244 | 244 | . pack("V", 0x1000) |
245 | 245 | . pack("V", 0) //Small Block Depot |
@@ -248,19 +248,19 @@ discard block |
||
248 | 248 | // Extra BDList Start, Count |
249 | 249 | if ($iBdCnt < $i1stBdL) { |
250 | 250 | fwrite($FILE, |
251 | - pack("V", -2). // Extra BDList Start |
|
251 | + pack("V", -2).// Extra BDList Start |
|
252 | 252 | pack("V", 0) // Extra BDList Count |
253 | 253 | ); |
254 | 254 | } else { |
255 | - fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL)); |
|
255 | + fwrite($FILE, pack("V", $iAll + $iBdCnt).pack("V", $iBdExL)); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | // BDList |
259 | 259 | for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; $i++) { |
260 | - fwrite($FILE, pack("V", $iAll+$i)); |
|
260 | + fwrite($FILE, pack("V", $iAll + $i)); |
|
261 | 261 | } |
262 | 262 | if ($i < $i1stBdL) { |
263 | - for ($j = 0; $j < ($i1stBdL-$i); $j++) { |
|
263 | + for ($j = 0; $j < ($i1stBdL - $i); $j++) { |
|
264 | 264 | fwrite($FILE, (pack("V", -1))); |
265 | 265 | } |
266 | 266 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | if (isset($raList[$i]->_PPS_FILE)) { |
289 | 289 | $iLen = 0; |
290 | 290 | fseek($raList[$i]->_PPS_FILE, 0); // To The Top |
291 | - while($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) { |
|
291 | + while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) { |
|
292 | 292 | $iLen += strlen($sBuff); |
293 | 293 | fwrite($FILE, $sBuff); |
294 | 294 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $raList[$i]->_StartBlock = $iStBlk; |
306 | 306 | $iStBlk += |
307 | 307 | (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + |
308 | - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
308 | + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
309 | 309 | } |
310 | 310 | // Close file for each PPS, and unlink it |
311 | 311 | if (isset($raList[$i]->_PPS_FILE)) { |
@@ -337,10 +337,10 @@ discard block |
||
337 | 337 | } |
338 | 338 | if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) { |
339 | 339 | $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) |
340 | - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); |
|
340 | + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0); |
|
341 | 341 | // Add to SBD |
342 | - for ($j = 0; $j < ($iSmbCnt-1); $j++) { |
|
343 | - fwrite($FILE, pack("V", $j+$iSmBlk+1)); |
|
342 | + for ($j = 0; $j < ($iSmbCnt - 1); $j++) { |
|
343 | + fwrite($FILE, pack("V", $j + $iSmBlk + 1)); |
|
344 | 344 | } |
345 | 345 | fwrite($FILE, pack("V", -2)); |
346 | 346 | |
@@ -413,16 +413,16 @@ discard block |
||
413 | 413 | $iBdExL = 0; |
414 | 414 | $iAll = $iBsize + $iPpsCnt + $iSbdSize; |
415 | 415 | $iAllW = $iAll; |
416 | - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); |
|
417 | - $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); |
|
416 | + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0); |
|
417 | + $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0); |
|
418 | 418 | // Calculate BD count |
419 | - if ($iBdCnt >$i1stBdL) { |
|
419 | + if ($iBdCnt > $i1stBdL) { |
|
420 | 420 | while (1) { |
421 | 421 | $iBdExL++; |
422 | 422 | $iAllW++; |
423 | - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); |
|
424 | - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); |
|
425 | - if ($iBdCnt <= ($iBdExL*$iBbCnt+ $i1stBdL)) { |
|
423 | + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0); |
|
424 | + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0); |
|
425 | + if ($iBdCnt <= ($iBdExL * $iBbCnt + $i1stBdL)) { |
|
426 | 426 | break; |
427 | 427 | } |
428 | 428 | } |
@@ -432,19 +432,19 @@ discard block |
||
432 | 432 | // Set for SBD |
433 | 433 | if ($iSbdSize > 0) { |
434 | 434 | for ($i = 0; $i < ($iSbdSize - 1); $i++) { |
435 | - fwrite($FILE, pack("V", $i+1)); |
|
435 | + fwrite($FILE, pack("V", $i + 1)); |
|
436 | 436 | } |
437 | 437 | fwrite($FILE, pack("V", -2)); |
438 | 438 | } |
439 | 439 | // Set for B |
440 | 440 | for ($i = 0; $i < ($iBsize - 1); $i++) { |
441 | - fwrite($FILE, pack("V", $i+$iSbdSize+1)); |
|
441 | + fwrite($FILE, pack("V", $i + $iSbdSize + 1)); |
|
442 | 442 | } |
443 | 443 | fwrite($FILE, pack("V", -2)); |
444 | 444 | |
445 | 445 | // Set for PPS |
446 | 446 | for ($i = 0; $i < ($iPpsCnt - 1); $i++) { |
447 | - fwrite($FILE, pack("V", $i+$iSbdSize+$iBsize+1)); |
|
447 | + fwrite($FILE, pack("V", $i + $iSbdSize + $iBsize + 1)); |
|
448 | 448 | } |
449 | 449 | fwrite($FILE, pack("V", -2)); |
450 | 450 | // Set for BBD itself ( 0xFFFFFFFD : BBD) |
@@ -463,17 +463,17 @@ discard block |
||
463 | 463 | } |
464 | 464 | // Extra BDList |
465 | 465 | if ($iBdCnt > $i1stBdL) { |
466 | - $iN=0; |
|
467 | - $iNb=0; |
|
468 | - for ($i = $i1stBdL;$i < $iBdCnt; $i++, $iN++) { |
|
466 | + $iN = 0; |
|
467 | + $iNb = 0; |
|
468 | + for ($i = $i1stBdL; $i < $iBdCnt; $i++, $iN++) { |
|
469 | 469 | if ($iN >= ($iBbCnt - 1)) { |
470 | 470 | $iN = 0; |
471 | 471 | $iNb++; |
472 | - fwrite($FILE, pack("V", $iAll+$iBdCnt+$iNb)); |
|
472 | + fwrite($FILE, pack("V", $iAll + $iBdCnt + $iNb)); |
|
473 | 473 | } |
474 | - fwrite($FILE, pack("V", $iBsize+$iSbdSize+$iPpsCnt+$i)); |
|
474 | + fwrite($FILE, pack("V", $iBsize + $iSbdSize + $iPpsCnt + $i)); |
|
475 | 475 | } |
476 | - if (($iBdCnt-$i1stBdL) % ($iBbCnt-1)) { |
|
476 | + if (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)) { |
|
477 | 477 | for ($i = 0; $i < (($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1))); $i++) { |
478 | 478 | fwrite($FILE, pack("V", -1)); |
479 | 479 | } |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * Constants for OLE package |
25 | 25 | */ |
26 | -define('OLE_PPS_TYPE_ROOT', 5); |
|
27 | -define('OLE_PPS_TYPE_DIR', 1); |
|
28 | -define('OLE_PPS_TYPE_FILE', 2); |
|
26 | +define('OLE_PPS_TYPE_ROOT', 5); |
|
27 | +define('OLE_PPS_TYPE_DIR', 1); |
|
28 | +define('OLE_PPS_TYPE_FILE', 2); |
|
29 | 29 | define('OLE_DATA_SIZE_SMALL', 0x1000); |
30 | -define('OLE_LONG_INT_SIZE', 4); |
|
31 | -define('OLE_PPS_SIZE', 0x80); |
|
30 | +define('OLE_LONG_INT_SIZE', 4); |
|
31 | +define('OLE_PPS_SIZE', 0x80); |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Array for storing OLE instances that are accessed from |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | for ($i = 0; $i < $bbatBlockCount; $i++) { |
184 | 184 | $pos = $this->_getBlockOffset($mbatBlocks[$i]); |
185 | 185 | fseek($fh, $pos); |
186 | - for ($j = 0 ; $j < $this->bigBlockSize / 4; $j++) { |
|
186 | + for ($j = 0; $j < $this->bigBlockSize / 4; $j++) { |
|
187 | 187 | $this->bbat[] = $this->_readInt4($fh); |
188 | 188 | } |
189 | 189 | } |
@@ -234,12 +234,12 @@ discard block |
||
234 | 234 | $GLOBALS['_OLE_INSTANCES'][] = $this; |
235 | 235 | $instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES'])); |
236 | 236 | |
237 | - $path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId; |
|
237 | + $path = 'ole-chainedblockstream://oleInstanceId='.$instanceId; |
|
238 | 238 | if (is_a($blockIdOrPps, 'OLE_PPS')) { |
239 | - $path .= '&blockId=' . $blockIdOrPps->_StartBlock; |
|
240 | - $path .= '&size=' . $blockIdOrPps->Size; |
|
239 | + $path .= '&blockId='.$blockIdOrPps->_StartBlock; |
|
240 | + $path .= '&size='.$blockIdOrPps->Size; |
|
241 | 241 | } else { |
242 | - $path .= '&blockId=' . $blockIdOrPps; |
|
242 | + $path .= '&blockId='.$blockIdOrPps; |
|
243 | 243 | } |
244 | 244 | return fopen($path, 'r'); |
245 | 245 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | { |
473 | 473 | $rawname = ''; |
474 | 474 | for ($i = 0; $i < strlen($ascii); $i++) { |
475 | - $rawname .= $ascii{$i} . "\x00"; |
|
475 | + $rawname .= $ascii{$i}."\x00"; |
|
476 | 476 | } |
477 | 477 | return $rawname; |
478 | 478 | } |
@@ -499,8 +499,8 @@ discard block |
||
499 | 499 | $days = 134774; |
500 | 500 | // calculate seconds |
501 | 501 | $big_date = $days * 24 * 3600 + |
502 | - gmmktime(date("H",$date),date("i",$date),date("s",$date), |
|
503 | - date("m",$date),date("d",$date),date("Y",$date)); |
|
502 | + gmmktime(date("H", $date), date("i", $date), date("s", $date), |
|
503 | + date("m", $date), date("d", $date), date("Y", $date)); |
|
504 | 504 | // multiply just to make MS happy |
505 | 505 | $big_date *= 10000000; |
506 | 506 | |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | |
540 | 540 | // factor used for separating numbers into 4 bytes parts |
541 | - $factor = pow(2,32); |
|
541 | + $factor = pow(2, 32); |
|
542 | 542 | $high_part = 0; |
543 | 543 | for ($i = 0; $i < 4; $i++) { |
544 | 544 | list(, $high_part) = unpack('C', $string{(7 - $i)}); |
@@ -189,10 +189,10 @@ |
||
189 | 189 | . "\x00\x00\x00\x00" // 100 |
190 | 190 | . OLE::LocalDate2OLE($this->Time1st) // 108 |
191 | 191 | . OLE::LocalDate2OLE($this->Time2nd) // 116 |
192 | - . pack("V", isset($this->_StartBlock)? |
|
193 | - $this->_StartBlock:0) // 120 |
|
192 | + . pack("V", isset($this->_StartBlock) ? |
|
193 | + $this->_StartBlock : 0) // 120 |
|
194 | 194 | . pack("V", $this->Size) // 124 |
195 | - . pack("V", 0); // 128 |
|
195 | + . pack("V", 0); // 128 |
|
196 | 196 | return $ret; |
197 | 197 | } |
198 | 198 |
@@ -76,7 +76,7 @@ |
||
76 | 76 | public static function factory($driver) |
77 | 77 | { |
78 | 78 | $driver = basename($driver); |
79 | - $class = 'Text_CAPTCHA_Driver_' . $driver; |
|
79 | + $class = 'Text_CAPTCHA_Driver_'.$driver; |
|
80 | 80 | /*$file = str_replace('_', '/', $class) . '.php'; |
81 | 81 | //check if it exists and can be loaded |
82 | 82 | if (!@fclose(@fopen($file, 'r', true))) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->_length = 4; |
71 | 71 | } |
72 | 72 | if (isset($options['phrase']) && !empty($options['phrase'])) { |
73 | - $this->setPhrase((string)$options['phrase']); |
|
73 | + $this->setPhrase((string) $options['phrase']); |
|
74 | 74 | } else { |
75 | 75 | $this->createPhrase(); |
76 | 76 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | if ($this->_mode == 'single') { |
117 | 117 | $phraseArr = str_split($phrase); |
118 | 118 | for ($i = 0; $i < strlen($phrase); $i++) { |
119 | - $res .= ' ' . $numberWords->toWords($phraseArr[$i], $this->_locale); |
|
119 | + $res .= ' '.$numberWords->toWords($phraseArr[$i], $this->_locale); |
|
120 | 120 | } |
121 | 121 | } else { |
122 | 122 | $res = $numberWords->toWords($phrase, $this->_locale); |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | public function initDriver($options = array()) |
81 | 81 | { |
82 | 82 | if (!empty($options['output'])) { |
83 | - $this->_output = (string)$options['output']; |
|
83 | + $this->_output = (string) $options['output']; |
|
84 | 84 | } else { |
85 | 85 | $this->_output = 'html'; |
86 | 86 | } |
87 | 87 | |
88 | 88 | if (isset($options['width']) && $options['width']) { |
89 | - $this->_width = (int)$options['width']; |
|
89 | + $this->_width = (int) $options['width']; |
|
90 | 90 | } else { |
91 | 91 | $this->_width = 200; |
92 | 92 | } |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | } |
202 | 202 | |
203 | 203 | $htmlOutput = '<div style="font-family: courier; |
204 | - font-size: ' . $textSize . 'px; |
|
205 | - width:' . $this->_width . 'px; |
|
204 | + font-size: ' . $textSize.'px; |
|
205 | + width:' . $this->_width.'px; |
|
206 | 206 | text-align:center;">'; |
207 | - $htmlOutput .= '<div style="' . $cssOutput . 'margin:0px;"> |
|
208 | - <pre style="padding: 0px; margin: 0px;">' . $data . '</pre></div></div>'; |
|
207 | + $htmlOutput .= '<div style="'.$cssOutput.'margin:0px;"> |
|
208 | + <pre style="padding: 0px; margin: 0px;">' . $data.'</pre></div></div>'; |
|
209 | 209 | |
210 | 210 | return $htmlOutput; |
211 | 211 | } |