Passed
Push — master ( 48d769...5ccf6e )
by Michael
07:14
created
include/class_eq_pie.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
 
115 115
             $piePart = $value[1];
116 116
             if (isset($this->total) && $this->total > 0) {
117
-                $piePart100 = round($piePart / $this->total * 100, 2);  // value in percentage, the rounding and * 100 for extra accuracy for pie w/o gaps
117
+                $piePart100 = round($piePart / $this->total * 100, 2); // value in percentage, the rounding and * 100 for extra accuracy for pie w/o gaps
118 118
             } else {
119 119
                 $piePart100 = 0;
120 120
             }
121 121
 
122
-            $piePart360 = $piePart100 * 3.6;                    // in degrees
122
+            $piePart360 = $piePart100 * 3.6; // in degrees
123 123
 
124 124
             $colR      = hexdec(substr($value[2], 1, 2));
125 125
             $colG      = hexdec(substr($value[2], 3, 2));
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
         foreach ($EQpieData as $i => $value) {
147 147
             $piePart = $value[1];
148 148
             if (isset($this->total) && $this->total > 0) {
149
-                $piePart100 = round($piePart / $this->total * 100, 2);  // value in percentage, the rounding and * 100 for extra accuracy for pie w/o gaps
149
+                $piePart100 = round($piePart / $this->total * 100, 2); // value in percentage, the rounding and * 100 for extra accuracy for pie w/o gaps
150 150
             } else {
151 151
                 $piePart100 = 0;
152 152
             }
153
-            $piePart360 = $piePart100 * 3.6;                    // in degrees
153
+            $piePart360 = $piePart100 * 3.6; // in degrees
154 154
 
155 155
             $colR      = hexdec(substr($value[2], 1, 2));
156 156
             $colG      = hexdec(substr($value[2], 3, 2));
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             foreach ($EQpieData as $i => $value) {
194 194
                 $piePart = $value[1];
195 195
                 if (isset($this->total) && $this->total > 0) {
196
-                    $piePart100 = round($piePart / $this->total * 100, 2);  // value in percentage, the rounding and * 100 for extra accuracy for pie w/o gaps
196
+                    $piePart100 = round($piePart / $this->total * 100, 2); // value in percentage, the rounding and * 100 for extra accuracy for pie w/o gaps
197 197
                 } else {
198 198
                     $piePart100 = 0;
199 199
                 }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                 imagefilledrectangle($legendImage, 5, $yOffset + 2, 5 + $box_width, $yOffset + $box_height + 2, $PartColor);
206 206
                 imagerectangle($legendImage, 5, $yOffset + 2, 5 + $box_width, $yOffset + $box_height + 2, $borderColor);
207 207
 
208
-                $text = $value[0] . ' ' . $piePart100 . '%';
208
+                $text = $value[0].' '.$piePart100.'%';
209 209
                 imagestring($legendImage, 2, '20', $yOffset, $text, $textColor);
210 210
                 $yOffset += 15;
211 211
             }
Please login to merge, or discard this patch.
include/color.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -216,8 +216,8 @@
 block discarded – undo
216 216
      */
217 217
     public function changeLightness($degree = 10)
218 218
     {
219
-        $color1 =& $this->color1;
220
-        $color2 =& $this->color2;
219
+        $color1 = & $this->color1;
220
+        $color2 = & $this->color2;
221 221
 
222 222
         for ($x = 0; $x < 3; ++$x) {
223 223
             if (($color1[$x] + $degree) < 256) {
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,35 +3,35 @@  discard block
 block discarded – undo
3 3
 
4 4
 use XoopsModules\Pedigree;
5 5
 
6
-require_once __DIR__ . '/header.php';
6
+require_once __DIR__.'/header.php';
7 7
 
8 8
 $moduleDirName = basename(__DIR__);
9 9
 xoops_loadLanguage('main', $moduleDirName);
10 10
 
11 11
 // Include any common code for this module.
12
-require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
13
-require_once __DIR__ . '/welcome.php';
12
+require_once XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/include/common.php';
13
+require_once __DIR__.'/welcome.php';
14 14
 
15 15
 $GLOBALS['xoopsOption']['template_main'] = 'pedigree_index.tpl';
16 16
 
17 17
 include $GLOBALS['xoops']->path('/header.php');
18 18
 
19 19
 //load javascript
20
-$xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
20
+$xoTheme->addScript(XOOPS_URL.'/browse.php?Frameworks/jquery/jquery.js');
21 21
 //$xoTheme->addScript(PEDIGREE_URL . '/assets/js/jquery.ThickBox/thickbox-compressed.js');
22 22
 
23
-$xoTheme->addScript(PEDIGREE_URL . '/assets/js/jquery.magnific-popup.min.js');
24
-$xoTheme->addScript(PEDIGREE_URL . '/assets/js/colpick.js');
23
+$xoTheme->addScript(PEDIGREE_URL.'/assets/js/jquery.magnific-popup.min.js');
24
+$xoTheme->addScript(PEDIGREE_URL.'/assets/js/colpick.js');
25 25
 
26 26
 //load CSS style sheets
27
-$xoTheme->addStylesheet(PEDIGREE_URL . '/assets/css/colpick.css');
28
-$xoTheme->addStylesheet(PEDIGREE_URL . '/assets/css/magnific-popup.css');
29
-$xoTheme->addStylesheet(PEDIGREE_URL . '/assets/css/style.css');
27
+$xoTheme->addStylesheet(PEDIGREE_URL.'/assets/css/colpick.css');
28
+$xoTheme->addStylesheet(PEDIGREE_URL.'/assets/css/magnific-popup.css');
29
+$xoTheme->addStylesheet(PEDIGREE_URL.'/assets/css/style.css');
30 30
 
31 31
 //$xoTheme->addStylesheet(PEDIGREE_URL . '/assets/css/jquery.ThickBox/thickbox.css');
32 32
 //$xoTheme->addStylesheet(PEDIGREE_URL . '/module.css');
33 33
 
34
-$GLOBALS['xoopsTpl']->assign('pedigree_url', PEDIGREE_URL . '/');
34
+$GLOBALS['xoopsTpl']->assign('pedigree_url', PEDIGREE_URL.'/');
35 35
 
36 36
 // Breadcrumb
37 37
 $breadcrumb = new Pedigree\Breadcrumb();
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
     if ($userField->isActive() && $userField->hasSearch()) {
59 59
         $fieldType   = $userField->getSetting('FieldType');
60 60
         $fieldObject = new $fieldType($userField, $animal);
61
-        $function    = 'user' . $iValue . $fieldObject->getSearchString();
61
+        $function    = 'user'.$iValue.$fieldObject->getSearchString();
62 62
         //echo $function."<br>";
63 63
         $usersearch[] = [
64 64
             'title'       => $userField->getSetting('SearchName'),
65
-            'searchid'    => 'user' . $iValue,
65
+            'searchid'    => 'user'.$iValue,
66 66
             'function'    => $function,
67 67
             'explanation' => $userField->getSetting('SearchExplanation'),
68 68
             'searchfield' => $fieldObject->searchfield()
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 }
72 72
 
73 73
 //$catarray['letters']          = Pedigree\Utility::lettersChoice();
74
-$letter              = '';
74
+$letter = '';
75 75
 $myObject     = Pedigree\Helper::getInstance();
76 76
 $activeObject = 'Tree';
77 77
 $name         = 'naam';
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 $link2        = '%25';
80 80
 
81 81
 $criteria = $myObject->getHandler('Tree')->getActiveCriteria();
82
-$criteria->setGroupby('UPPER(LEFT(' . $name . ',1))');
82
+$criteria->setGroupby('UPPER(LEFT('.$name.',1))');
83 83
 $catarray['letters'] = Pedigree\Utility::lettersChoice($myObject, $activeObject, $criteria, $name, $link, $link2);
84 84
 //$catarray['toolbar']          = pedigree_toolbar();
85 85
 $xoopsTpl->assign('catarray', $catarray);
Please login to merge, or discard this patch.
dog.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
 use XoopsModules\Pedigree;
6 6
 
7 7
 //require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
8
-require_once __DIR__ . '/header.php';
8
+require_once __DIR__.'/header.php';
9 9
 $moduleDirName = basename(__DIR__);
10 10
 xoops_loadLanguage('main', $moduleDirName);
11 11
 // Include any common code for this module.
12
-require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
12
+require_once XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/include/common.php';
13 13
 
14 14
 // Get all HTTP post or get parameters into global variables that are prefixed with "param_"
15 15
 //import_request_variables("gp", "param_");
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 extract($_POST, EXTR_PREFIX_ALL, 'param');
18 18
 
19 19
 $GLOBALS['xoopsOption']['template_main'] = 'pedigree_dog.tpl';
20
-include XOOPS_ROOT_PATH . '/header.php';
20
+include XOOPS_ROOT_PATH.'/header.php';
21 21
 
22 22
 global $xoopsUser, $xoopsTpl, $xoopsDB, $xoopsModuleConfig, $xoopsModule;
23 23
 global $numofcolumns, $numMatch, $pages, $columns, $dogs;
@@ -43,78 +43,78 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 if (isset($_GET['delpicture']) && 'true' === $_GET['delpicture']) {
46
-    $delpicsql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " SET foto = '' WHERE id = '" . $id . "'";
46
+    $delpicsql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." SET foto = '' WHERE id = '".$id."'";
47 47
     $GLOBALS['xoopsDB']->query($delpicsql);
48 48
 }
49 49
 //query
50
-$queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE id=' . $id;
50
+$queryString = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE id='.$id;
51 51
 $result      = $GLOBALS['xoopsDB']->query($queryString);
52 52
 
53 53
 while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
54 54
     //name
55 55
     $naam = stripslashes($row['naam']);
56
-    $xoopsTpl->assign('xoops_pagetitle', $naam . ' -- detailed information');
56
+    $xoopsTpl->assign('xoops_pagetitle', $naam.' -- detailed information');
57 57
     //owner
58 58
     if ('0' != $row['id_owner']) {
59
-        $queryeig = 'SELECT id, lastname, firstname FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_owner') . ' WHERE id=' . $row['id_owner'];
59
+        $queryeig = 'SELECT id, lastname, firstname FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_owner').' WHERE id='.$row['id_owner'];
60 60
         $reseig   = $GLOBALS['xoopsDB']->query($queryeig);
61 61
         while (false !== ($roweig = $GLOBALS['xoopsDB']->fetchArray($reseig))) {
62
-            $eig = '<a href="owner.php?ownid=' . $roweig['id'] . '">' . $roweig['firstname'] . ' ' . $roweig['lastname'] . '</a>';
62
+            $eig = '<a href="owner.php?ownid='.$roweig['id'].'">'.$roweig['firstname'].' '.$roweig['lastname'].'</a>';
63 63
         }
64 64
     } else {
65
-        $eig = '<a href="update.php?id=' . $row['id'] . '&fld=ow">' . _MA_PEDIGREE_UNKNOWN . '</a>';
65
+        $eig = '<a href="update.php?id='.$row['id'].'&fld=ow">'._MA_PEDIGREE_UNKNOWN.'</a>';
66 66
     }
67 67
     //breeder
68 68
     if ('0' != $row['id_breeder']) {
69
-        $queryfok = 'SELECT id, lastname, firstname FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_owner') . ' WHERE id=' . $row['id_breeder'];
69
+        $queryfok = 'SELECT id, lastname, firstname FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_owner').' WHERE id='.$row['id_breeder'];
70 70
         $resfok   = $GLOBALS['xoopsDB']->query($queryfok);
71 71
         while (false !== ($rowfok = $GLOBALS['xoopsDB']->fetchArray($resfok))) {
72
-            $fok = '<a href="owner.php?ownid=' . $rowfok['id'] . '">' . $rowfok['firstname'] . ' ' . $rowfok['lastname'] . '</a>';
72
+            $fok = '<a href="owner.php?ownid='.$rowfok['id'].'">'.$rowfok['firstname'].' '.$rowfok['lastname'].'</a>';
73 73
         }
74 74
     } else {
75
-        $fok = '<a href="update.php?id=' . $row['id'] . '&fld=br">' . _MA_PEDIGREE_UNKNOWN . '</a>';
75
+        $fok = '<a href="update.php?id='.$row['id'].'&fld=br">'._MA_PEDIGREE_UNKNOWN.'</a>';
76 76
     }
77 77
     //gender
78 78
     if (0 == $row['roft']) {
79
-        $gender = '<img src="assets/images/male.gif"> ' . strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]);
79
+        $gender = '<img src="assets/images/male.gif"> '.strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]);
80 80
     } else {
81
-        $gender = '<img src="assets/images/female.gif"> ' . strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']]);
81
+        $gender = '<img src="assets/images/female.gif"> '.strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']]);
82 82
     }
83 83
     //Sire
84 84
     if (0 != $row['father']) {
85
-        $querysire = 'SELECT naam FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE id=' . $row['father'];
85
+        $querysire = 'SELECT naam FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE id='.$row['father'];
86 86
         $ressire   = $GLOBALS['xoopsDB']->query($querysire);
87 87
         while (false !== ($rowsire = $GLOBALS['xoopsDB']->fetchArray($ressire))) {
88
-            $sire = '<img src="assets/images/male.gif"><a href="dog.php?id=' . $row['father'] . '">' . stripslashes($rowsire['naam']) . '</a>';
88
+            $sire = '<img src="assets/images/male.gif"><a href="dog.php?id='.$row['father'].'">'.stripslashes($rowsire['naam']).'</a>';
89 89
         }
90 90
     } else {
91
-        $sire = '<img src="assets/images/male.gif"><a href="seldog.php?curval=' . $row['id'] . '&gend=0&letter=A">' . _MA_PEDIGREE_UNKNOWN . '</a>';
91
+        $sire = '<img src="assets/images/male.gif"><a href="seldog.php?curval='.$row['id'].'&gend=0&letter=A">'._MA_PEDIGREE_UNKNOWN.'</a>';
92 92
     }
93 93
     //Dam
94 94
     if (0 != $row['mother']) {
95
-        $querydam = 'SELECT naam FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE id=' . $row['mother'];
95
+        $querydam = 'SELECT naam FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE id='.$row['mother'];
96 96
         $resdam   = $GLOBALS['xoopsDB']->query($querydam);
97 97
         while (false !== ($rowdam = $GLOBALS['xoopsDB']->fetchArray($resdam))) {
98
-            $dam = '<img src="assets/images/female.gif"><a href="dog.php?id=' . $row['mother'] . '">' . stripslashes($rowdam['naam']) . '</a>';
98
+            $dam = '<img src="assets/images/female.gif"><a href="dog.php?id='.$row['mother'].'">'.stripslashes($rowdam['naam']).'</a>';
99 99
         }
100 100
     } else {
101
-        $dam = '<img src="assets/images/female.gif"><a href="seldog.php?curval=' . $row['id'] . '&gend=1&letter=A">' . _MA_PEDIGREE_UNKNOWN . '</a>';
101
+        $dam = '<img src="assets/images/female.gif"><a href="seldog.php?curval='.$row['id'].'&gend=1&letter=A">'._MA_PEDIGREE_UNKNOWN.'</a>';
102 102
     }
103 103
     //picture
104 104
     if ('' != $row['foto']) {
105
-        $picture = '<img src=' . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['foto'] . '_400.jpeg>';
105
+        $picture = '<img src='.PEDIGREE_UPLOAD_URL.'/images/thumbnails/'.$row['foto'].'_400.jpeg>';
106 106
     } else {
107
-        $picture = '<a href="update.php?id=' . $row['id'] . '&fld=pc">' . _MA_PEDIGREE_UNKNOWN . '</a>';
107
+        $picture = '<a href="update.php?id='.$row['id'].'&fld=pc">'._MA_PEDIGREE_UNKNOWN.'</a>';
108 108
     }
109 109
     //inbred precentage
110 110
     if ('' == $row['coi']) {
111 111
         if (0 != $row['father'] && 0 != $row['mother']) {
112
-            $inbred = '<a href="coi.php?s=' . $row['father'] . '&d=' . $row['mother'] . '&dogid=' . $row['id'] . '&detail=1">' . strtr(_MA_PEDIGREE_COI_WAIT, ['[animalType]' => $moduleConfig['animalType']]) . '</a>';
112
+            $inbred = '<a href="coi.php?s='.$row['father'].'&d='.$row['mother'].'&dogid='.$row['id'].'&detail=1">'.strtr(_MA_PEDIGREE_COI_WAIT, ['[animalType]' => $moduleConfig['animalType']]).'</a>';
113 113
         } else {
114 114
             $inbred = _MA_PEDIGREE_COI_MORE;
115 115
         }
116 116
     } else {
117
-        $inbred = '<a href="coi.php?s=' . $row['father'] . '&d=' . $row['mother'] . '&dogid=' . $row['id'] . '&detail=1" title="' . strtr(_MA_PEDIGREE_COI_WAIT, ['[animalType]' => $moduleConfig['animalType']]) . '">' . $row['coi'] . ' %</a>';
117
+        $inbred = '<a href="coi.php?s='.$row['father'].'&d='.$row['mother'].'&dogid='.$row['id'].'&detail=1" title="'.strtr(_MA_PEDIGREE_COI_WAIT, ['[animalType]' => $moduleConfig['animalType']]).'">'.$row['coi'].' %</a>';
118 118
     }
119 119
     //brothers and sisters
120 120
     $bas = Pedigree\Utility::bas($id, $row['father'], $row['mother']);
@@ -137,46 +137,46 @@  discard block
 block discarded – undo
137 137
     //name
138 138
     $items[] = [
139 139
         'header' => _MA_PEDIGREE_FLD_NAME,
140
-        'data'   => '<a href="pedigree.php?pedid=' . $row['id'] . '">' . $naam . '</a> (click to view pedigree)',
141
-        'edit'   => '<a href="update.php?id=' . $row['id'] . "&fld=nm\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
140
+        'data'   => '<a href="pedigree.php?pedid='.$row['id'].'">'.$naam.'</a> (click to view pedigree)',
141
+        'edit'   => '<a href="update.php?id='.$row['id']."&fld=nm\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
142 142
     ];
143 143
     if ('1' == $moduleConfig['ownerbreeder']) {
144 144
         //owner
145 145
         $items[] = [
146 146
             'header' => _MA_PEDIGREE_FLD_OWNE,
147 147
             'data'   => $eig,
148
-            'edit'   => '<a href="update.php?id=' . $row['id'] . "&fld=ow\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
148
+            'edit'   => '<a href="update.php?id='.$row['id']."&fld=ow\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
149 149
         ];
150 150
         //breeder
151 151
         $items[] = [
152 152
             'header' => _MA_PEDIGREE_FLD_BREE,
153 153
             'data'   => $fok,
154
-            'edit'   => '<a href="update.php?id=' . $row['id'] . "&fld=br\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
154
+            'edit'   => '<a href="update.php?id='.$row['id']."&fld=br\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
155 155
         ];
156 156
     }
157 157
     //gender
158 158
     $items[] = [
159 159
         'header' => _MA_PEDIGREE_FLD_GEND,
160 160
         'data'   => $gender,
161
-        'edit'   => '<a href="update.php?id=' . $row['id'] . "&fld=sx\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
161
+        'edit'   => '<a href="update.php?id='.$row['id']."&fld=sx\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
162 162
     ];
163 163
     //sire
164 164
     $items[] = [
165 165
         'header' => strtr(_MA_PEDIGREE_FLD_FATH, ['[father]' => $moduleConfig['father']]),
166 166
         'data'   => $sire,
167
-        'edit'   => '<a href="seldog.php?curval=' . $row['id'] . "&gend=0&letter=A\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
167
+        'edit'   => '<a href="seldog.php?curval='.$row['id']."&gend=0&letter=A\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
168 168
     ];
169 169
     //dam
170 170
     $items[] = [
171 171
         'header' => strtr(_MA_PEDIGREE_FLD_MOTH, ['[mother]' => $moduleConfig['mother']]),
172 172
         'data'   => $dam,
173
-        'edit'   => '<a href="seldog.php?curval=' . $row['id'] . "&gend=1&letter=A\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
173
+        'edit'   => '<a href="seldog.php?curval='.$row['id']."&gend=1&letter=A\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
174 174
     ];
175 175
     //picture
176 176
     $items[] = [
177 177
         'header' => _MA_PEDIGREE_FLD_PICT,
178 178
         'data'   => $picture,
179
-        'edit'   => '<a href="update.php?id=' . $row['id'] . "&fld=pc\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a><a href=\"dog.php?id=" . $row['id'] . "&delpicture=true\"><img src=' " . $pathIcon16 . "/delete.png' border='0' alt=_DELETE title=_DELETE></a>"
179
+        'edit'   => '<a href="update.php?id='.$row['id']."&fld=pc\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a><a href=\"dog.php?id=".$row['id']."&delpicture=true\"><img src=' ".$pathIcon16."/delete.png' border='0' alt=_DELETE title=_DELETE></a>"
180 180
     ];
181 181
 
182 182
     //userdefined fields
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                 $items[] = [
203 203
                     'header' => $userField->getSetting('FieldName'),
204 204
                     'data'   => $fieldObject->showValue(),
205
-                    'edit'   => '<a href="update.php?id=' . $row['id'] . '&fld=' . $iValue . "\"><img src=' " . $pathIcon16 . "/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
205
+                    'edit'   => '<a href="update.php?id='.$row['id'].'&fld='.$iValue."\"><img src=' ".$pathIcon16."/edit.png' border='0' alt=_EDIT title=_EDIT></a>"
206 206
                 ];
207 207
             }
208 208
         }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     if ('1' == $moduleConfig['proversion']) {
256 256
         $items[] = [
257 257
             'header' => 'Inbred Pedigree',
258
-            'data'   => '<a href="mpedigree.php?pedid=' . $row['id'] . '">Inbreeding pedigree</a>',
258
+            'data'   => '<a href="mpedigree.php?pedid='.$row['id'].'">Inbreeding pedigree</a>',
259 259
             'edit'   => ''
260 260
         ];
261 261
     }
@@ -268,13 +268,13 @@  discard block
 block discarded – undo
268 268
 $xoopsTpl->assign('dogs', $dogs);
269 269
 $xoopsTpl->assign('columns', $columns);
270 270
 $xoopsTpl->assign('numofcolumns', $numofcolumns);
271
-$xoopsTpl->assign('nummatch', $numMatch . ' Animals found.');
271
+$xoopsTpl->assign('nummatch', $numMatch.' Animals found.');
272 272
 
273 273
 //bas
274 274
 $xoopsTpl->assign('dogs1', $dogs1);
275 275
 $xoopsTpl->assign('columns1', $columns1);
276 276
 $xoopsTpl->assign('numofcolumns1', $numofcolumns1);
277
-$xoopsTpl->assign('nummatch1', $nummatch1 . ' Animals found.');
277
+$xoopsTpl->assign('nummatch1', $nummatch1.' Animals found.');
278 278
 
279 279
 //both pups and bas
280 280
 $xoopsTpl->assign('width', 100 / $numofcolumns);
@@ -293,5 +293,5 @@  discard block
 block discarded – undo
293 293
 $xoopsTpl->assign('delete', _DELETE);
294 294
 
295 295
 //comments and footer
296
-include XOOPS_ROOT_PATH . '/include/comment_view.php';
297
-include XOOPS_ROOT_PATH . '/footer.php';
296
+include XOOPS_ROOT_PATH.'/include/comment_view.php';
297
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
phpthumb/phpThumb.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
         return false;
34 34
     }
35 35
     global $phpThumb;
36
-    $downloadfilename = phpthumb_functions::SanitizeFilename(!empty($_GET['sia']) ? $_GET['sia'] : (!empty($_GET['down']) ? $_GET['down'] : 'phpThumb_generated_thumbnail.' . (!empty($_GET['f']) ? $_GET['f'] : 'jpg')));
36
+    $downloadfilename = phpthumb_functions::SanitizeFilename(!empty($_GET['sia']) ? $_GET['sia'] : (!empty($_GET['down']) ? $_GET['down'] : 'phpThumb_generated_thumbnail.'.(!empty($_GET['f']) ? $_GET['f'] : 'jpg')));
37 37
     if (!empty($downloadfilename)) {
38
-        $phpThumb->DebugMessage('SendSaveAsFileHeaderIfNeeded() sending header: Content-Disposition: ' . (!empty($_GET['down']) ? 'attachment' : 'inline') . '; filename="' . $downloadfilename . '"', __FILE__, __LINE__);
39
-        header('Content-Disposition: ' . (!empty($_GET['down']) ? 'attachment' : 'inline') . '; filename="' . $downloadfilename . '"');
38
+        $phpThumb->DebugMessage('SendSaveAsFileHeaderIfNeeded() sending header: Content-Disposition: '.(!empty($_GET['down']) ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"', __FILE__, __LINE__);
39
+        header('Content-Disposition: '.(!empty($_GET['down']) ? 'attachment' : 'inline').'; filename="'.$downloadfilename.'"');
40 40
     }
41 41
 
42 42
     return true;
@@ -72,43 +72,43 @@  discard block
 block discarded – undo
72 72
     } elseif ($phpThumb->phpThumbDebug) {
73 73
         $phpThumb->DebugTimingMessage('skipped using cached image', __FILE__, __LINE__);
74 74
         $phpThumb->DebugMessage('Would have used cached file, but skipping due to phpThumbDebug', __FILE__, __LINE__);
75
-        $phpThumb->DebugMessage('* Would have sent headers (1): Last-Modified: ' . gmdate('D, d M Y H:i:s', $nModified) . ' GMT', __FILE__, __LINE__);
75
+        $phpThumb->DebugMessage('* Would have sent headers (1): Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT', __FILE__, __LINE__);
76 76
         if ($getimagesize = @getimagesize($phpThumb->cache_filename)) {
77
-            $phpThumb->DebugMessage('* Would have sent headers (2): Content-Type: ' . phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]), __FILE__, __LINE__);
77
+            $phpThumb->DebugMessage('* Would have sent headers (2): Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]), __FILE__, __LINE__);
78 78
         }
79
-        if (preg_match('#^' . preg_quote($nice_docroot) . '(.*)$#', $nice_cachefile, $matches)) {
80
-            $phpThumb->DebugMessage('* Would have sent headers (3): Location: ' . dirname($matches[1]) . '/' . urlencode(basename($matches[1])), __FILE__, __LINE__);
79
+        if (preg_match('#^'.preg_quote($nice_docroot).'(.*)$#', $nice_cachefile, $matches)) {
80
+            $phpThumb->DebugMessage('* Would have sent headers (3): Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1])), __FILE__, __LINE__);
81 81
         } else {
82
-            $phpThumb->DebugMessage('* Would have sent data: readfile(' . $phpThumb->cache_filename . ')', __FILE__, __LINE__);
82
+            $phpThumb->DebugMessage('* Would have sent data: readfile('.$phpThumb->cache_filename.')', __FILE__, __LINE__);
83 83
         }
84 84
     } else {
85 85
         if (headers_sent()) {
86
-            $phpThumb->ErrorImage('Headers already sent (' . basename(__FILE__) . ' line ' . __LINE__ . ')');
86
+            $phpThumb->ErrorImage('Headers already sent ('.basename(__FILE__).' line '.__LINE__.')');
87 87
             exit;
88 88
         }
89 89
         SendSaveAsFileHeaderIfNeeded();
90 90
 
91 91
         header('Cache-Control: private');
92 92
         header('Pragma: private');
93
-        header('Cache-Control: max-age=' . $phpThumb->getParameter('config_cache_maxage'));
94
-        header('Expires: ' . date(DATE_RFC1123, time() + $phpThumb->getParameter('config_cache_maxage')));
93
+        header('Cache-Control: max-age='.$phpThumb->getParameter('config_cache_maxage'));
94
+        header('Expires: '.date(DATE_RFC1123, time() + $phpThumb->getParameter('config_cache_maxage')));
95 95
         if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) && ($nModified == strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']))
96 96
             && !empty($_SERVER['SERVER_PROTOCOL'])) {
97
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $nModified) . ' GMT');
98
-            header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
97
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT');
98
+            header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
99 99
             exit;
100 100
         }
101
-        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $nModified) . ' GMT');
102
-        header('ETag: "' . md5_file($phpThumb->cache_filename) . '"');
101
+        header('Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT');
102
+        header('ETag: "'.md5_file($phpThumb->cache_filename).'"');
103 103
         if ($getimagesize = @getimagesize($phpThumb->cache_filename)) {
104
-            header('Content-Type: ' . phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]));
104
+            header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]));
105 105
         } elseif (preg_match('#\\.ico$#i', $phpThumb->cache_filename)) {
106 106
             header('Content-Type: image/x-icon');
107 107
         }
108
-        header('Content-Length: ' . filesize($phpThumb->cache_filename));
108
+        header('Content-Length: '.filesize($phpThumb->cache_filename));
109 109
         if (empty($phpThumb->config_cache_force_passthru)
110
-            && preg_match('#^' . preg_quote($nice_docroot) . '(.*)$#', $nice_cachefile, $matches)) {
111
-            header('Location: ' . dirname($matches[1]) . '/' . urlencode(basename($matches[1])));
110
+            && preg_match('#^'.preg_quote($nice_docroot).'(.*)$#', $nice_cachefile, $matches)) {
111
+            header('Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1])));
112 112
         } else {
113 113
             @readfile($phpThumb->cache_filename);
114 114
         }
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 
121 121
 // instantiate a new phpThumb() object
122 122
 ob_start();
123
-if (!require_once __DIR__ . '/phpthumb.class.php') {
123
+if (!require_once __DIR__.'/phpthumb.class.php') {
124 124
     ob_end_flush();
125
-    die('failed to include_once("' . realpath(__DIR__ . '/phpthumb.class.php') . '")');
125
+    die('failed to include_once("'.realpath(__DIR__.'/phpthumb.class.php').'")');
126 126
 }
127 127
 ob_end_clean();
128 128
 $phpThumb = new phpThumb();
@@ -130,36 +130,36 @@  discard block
 block discarded – undo
130 130
 $phpThumb->setParameter('config_error_die_on_error', true);
131 131
 
132 132
 if (!phpthumb_functions::FunctionIsDisabled('set_time_limit')) {
133
-    set_time_limit(60);  // shouldn't take nearly this long in most cases, but with many filters and/or a slow server...
133
+    set_time_limit(60); // shouldn't take nearly this long in most cases, but with many filters and/or a slow server...
134 134
 }
135 135
 
136 136
 // phpThumbDebug[0] used to be here, but may reveal too much
137 137
 // info when high_security_mode should be enabled (not set yet)
138 138
 
139
-if (file_exists(__DIR__ . '/phpThumb.config.php')) {
139
+if (file_exists(__DIR__.'/phpThumb.config.php')) {
140 140
     ob_start();
141
-    if (require_once __DIR__ . '/phpThumb.config.php') {
141
+    if (require_once __DIR__.'/phpThumb.config.php') {
142 142
         // great
143 143
     } else {
144 144
         ob_end_flush();
145 145
         $phpThumb->config_disable_debug = false; // otherwise error message won't print
146
-        $phpThumb->ErrorImage('failed to include_once(' . __DIR__ . '/phpThumb.config.php) - realpath="' . realpath(__DIR__ . '/phpThumb.config.php') . '"');
146
+        $phpThumb->ErrorImage('failed to include_once('.__DIR__.'/phpThumb.config.php) - realpath="'.realpath(__DIR__.'/phpThumb.config.php').'"');
147 147
     }
148 148
     ob_end_clean();
149
-} elseif (file_exists(__DIR__ . '/phpThumb.config.php.default')) {
149
+} elseif (file_exists(__DIR__.'/phpThumb.config.php.default')) {
150 150
     $phpThumb->config_disable_debug = false; // otherwise error message won't print
151 151
     $phpThumb->ErrorImage('Please rename "phpThumb.config.php.default" to "phpThumb.config.php"');
152 152
 } else {
153 153
     $phpThumb->config_disable_debug = false; // otherwise error message won't print
154
-    $phpThumb->ErrorImage('failed to include_once(' . __DIR__ . '/phpThumb.config.php) - realpath="' . realpath(__DIR__ . '/phpThumb.config.php') . '"');
154
+    $phpThumb->ErrorImage('failed to include_once('.__DIR__.'/phpThumb.config.php) - realpath="'.realpath(__DIR__.'/phpThumb.config.php').'"');
155 155
 }
156 156
 
157 157
 if (!empty($PHPTHUMB_CONFIG)) {
158 158
     foreach ($PHPTHUMB_CONFIG as $key => $value) {
159
-        $keyname = 'config_' . $key;
159
+        $keyname = 'config_'.$key;
160 160
         $phpThumb->setParameter($keyname, $value);
161 161
         if (!preg_match('#(password|mysql)#i', $key)) {
162
-            $phpThumb->DebugMessage('setParameter(' . $keyname . ', ' . $phpThumb->phpThumbDebugVarDump($value) . ')', __FILE__, __LINE__);
162
+            $phpThumb->DebugMessage('setParameter('.$keyname.', '.$phpThumb->phpThumbDebugVarDump($value).')', __FILE__, __LINE__);
163 163
         }
164 164
     }
165 165
     if (!$phpThumb->config_disable_debug) {
@@ -176,10 +176,10 @@  discard block
 block discarded – undo
176 176
     $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', @$_SERVER['PHP_SELF']);
177 177
 
178 178
     $args = explode(';', substr($_SERVER['PATH_INFO'], 1));
179
-    $phpThumb->DebugMessage('PATH_INFO.$args set to (' . implode(')(', $args) . ')', __FILE__, __LINE__);
179
+    $phpThumb->DebugMessage('PATH_INFO.$args set to ('.implode(')(', $args).')', __FILE__, __LINE__);
180 180
     if (!empty($args)) {
181 181
         $_GET['src'] = @$args[count($args) - 1];
182
-        $phpThumb->DebugMessage('PATH_INFO."src" = "' . $_GET['src'] . '"', __FILE__, __LINE__);
182
+        $phpThumb->DebugMessage('PATH_INFO."src" = "'.$_GET['src'].'"', __FILE__, __LINE__);
183 183
         if (preg_match('#^new\=([a-z0-9]+)#i', $_GET['src'], $matches)) {
184 184
             unset($_GET['src']);
185 185
             $_GET['new'] = $matches[1];
@@ -188,17 +188,17 @@  discard block
 block discarded – undo
188 188
     if (preg_match('#^([0-9]*)x?([0-9]*)$#i', @$args[count($args) - 2], $matches)) {
189 189
         $_GET['w'] = $matches[1];
190 190
         $_GET['h'] = $matches[2];
191
-        $phpThumb->DebugMessage('PATH_INFO."w"x"h" set to "' . $_GET['w'] . '"x"' . $_GET['h'] . '"', __FILE__, __LINE__);
191
+        $phpThumb->DebugMessage('PATH_INFO."w"x"h" set to "'.$_GET['w'].'"x"'.$_GET['h'].'"', __FILE__, __LINE__);
192 192
     }
193 193
     for ($i = 0; $i < count($args) - 2; $i++) {
194 194
         @list($key, $value) = explode('=', @$args[$i]);
195 195
         if ('[]' === substr($key, -2)) {
196 196
             $array_key_name          = substr($key, 0, -2);
197 197
             $_GET[$array_key_name][] = $value;
198
-            $phpThumb->DebugMessage('PATH_INFO."' . $array_key_name . '[]" = "' . $value . '"', __FILE__, __LINE__);
198
+            $phpThumb->DebugMessage('PATH_INFO."'.$array_key_name.'[]" = "'.$value.'"', __FILE__, __LINE__);
199 199
         } else {
200 200
             $_GET[$key] = $value;
201
-            $phpThumb->DebugMessage('PATH_INFO."' . $key . '" = "' . $value . '"', __FILE__, __LINE__);
201
+            $phpThumb->DebugMessage('PATH_INFO."'.$key.'" = "'.$value.'"', __FILE__, __LINE__);
202 202
         }
203 203
     }
204 204
 }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     } elseif (phpthumb_functions::PasswordStrength($phpThumb->config_high_security_password) < 20) {
211 211
         $phpThumb->config_disable_debug = false; // otherwise error message won't print
212 212
         $phpThumb->ErrorImage('ERROR: $PHPTHUMB_CONFIG[high_security_password] is not complex enough');
213
-    } elseif ($_GET['hash'] != md5(str_replace($phpThumb->config_high_security_url_separator . 'hash=' . $_GET['hash'], '', $_SERVER['QUERY_STRING']) . $phpThumb->config_high_security_password)) {
213
+    } elseif ($_GET['hash'] != md5(str_replace($phpThumb->config_high_security_url_separator.'hash='.$_GET['hash'], '', $_SERVER['QUERY_STRING']).$phpThumb->config_high_security_password)) {
214 214
         header('HTTP/1.0 403 Forbidden');
215 215
         sleep(10); // deliberate delay to discourage password-guessing
216 216
         $phpThumb->ErrorImage('ERROR: invalid hash');
@@ -253,26 +253,26 @@  discard block
 block discarded – undo
253 253
                 $md5s = md5($rawImageData);
254 254
             }
255 255
         } else {
256
-            $phpThumb->ErrorImage('only FTP and HTTP/HTTPS protocols are allowed, "' . $protocol_matches[1] . '" is not');
256
+            $phpThumb->ErrorImage('only FTP and HTTP/HTTPS protocols are allowed, "'.$protocol_matches[1].'" is not');
257 257
         }
258 258
     } else {
259 259
         $SourceFilename = $phpThumb->ResolveFilenameToAbsolute($_GET['src']);
260 260
         if (is_readable($SourceFilename)) {
261 261
             $md5s = phpthumb_functions::md5_file_safe($SourceFilename);
262 262
         } else {
263
-            $phpThumb->ErrorImage('ERROR: "' . $SourceFilename . '" cannot be read');
263
+            $phpThumb->ErrorImage('ERROR: "'.$SourceFilename.'" cannot be read');
264 264
         }
265 265
     }
266 266
    if (\Xmf\Request::hasVar('HTTP_REFERER', 'SERVER')) {
267
-        $phpThumb->ErrorImage('&md5s=' . $md5s);
267
+        $phpThumb->ErrorImage('&md5s='.$md5s);
268 268
     } else {
269
-        die('&md5s=' . $md5s);
269
+        die('&md5s='.$md5s);
270 270
     }
271 271
 }
272 272
 
273 273
 if (!empty($_GET['src']) && empty($phpThumb->config_allow_local_http_src)
274
-    && preg_match('#^http://' . @$_SERVER['HTTP_HOST'] . '(.+)#i', $_GET['src'], $matches)) {
275
-    $phpThumb->ErrorImage('It is MUCH better to specify the "src" parameter as "' . $matches[1] . '" instead of "' . $matches[0] . '".' . "\n\n" . 'If you really must do it this way, enable "allow_local_http_src" in phpThumb.config.php');
274
+    && preg_match('#^http://'.@$_SERVER['HTTP_HOST'].'(.+)#i', $_GET['src'], $matches)) {
275
+    $phpThumb->ErrorImage('It is MUCH better to specify the "src" parameter as "'.$matches[1].'" instead of "'.$matches[0].'".'."\n\n".'If you really must do it this way, enable "allow_local_http_src" in phpThumb.config.php');
276 276
 }
277 277
 
278 278
 ////////////////////////////////////////////////////////////////
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 $parsed_url_referer = phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']);
287 287
 if ($phpThumb->config_nooffsitelink_require_refer
288 288
     && !in_array(@$parsed_url_referer['host'], $phpThumb->config_nohotlink_valid_domains)) {
289
-    $phpThumb->ErrorImage('config_nooffsitelink_require_refer enabled and ' . (@$parsed_url_referer['host'] ? '"' . $parsed_url_referer['host'] . '" is not an allowed referer' : 'no HTTP_REFERER exists'));
289
+    $phpThumb->ErrorImage('config_nooffsitelink_require_refer enabled and '.(@$parsed_url_referer['host'] ? '"'.$parsed_url_referer['host'].'" is not an allowed referer' : 'no HTTP_REFERER exists'));
290 290
 }
291 291
 $parsed_url_src = phpthumb_functions::ParseURLbetter(@$_GET['src']);
292 292
 if ($phpThumb->config_nohotlink_enabled && $phpThumb->config_nohotlink_erase_image
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
             }
306 306
         }
307 307
         if ($found_missing_function) {
308
-            $phpThumb->ErrorImage('SQL function unavailable: ' . $found_missing_function);
308
+            $phpThumb->ErrorImage('SQL function unavailable: '.$found_missing_function);
309 309
         } else {
310 310
             $mysqli = new mysqli($phpThumb->config_mysql_hostname, $phpThumb->config_mysql_username, $phpThumb->config_mysql_password, $phpThumb->config_mysql_database);
311 311
             if ($mysqli->connect_error) {
312
-                $phpThumb->ErrorImage('MySQLi connect error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);
312
+                $phpThumb->ErrorImage('MySQLi connect error ('.$mysqli->connect_errno.') '.$mysqli->connect_error);
313 313
             } else {
314 314
                 if ($result = $mysqli->query($phpThumb->config_mysql_query)) {
315 315
                     if ($row = $result->fetch_array()) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                     }
325 325
                 } else {
326 326
                     $mysqli->close();
327
-                    $phpThumb->ErrorImage('Error in MySQL query: "' . $mysqli->error . '"');
327
+                    $phpThumb->ErrorImage('Error in MySQL query: "'.$mysqli->error.'"');
328 328
                 }
329 329
             }
330 330
             unset($_GET['id']);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             }
340 340
         }
341 341
         if ($found_missing_function) {
342
-            $phpThumb->ErrorImage('SQL function unavailable: ' . $found_missing_function);
342
+            $phpThumb->ErrorImage('SQL function unavailable: '.$found_missing_function);
343 343
         } else {
344 344
             if ($cid = @mysql_connect($phpThumb->config_mysql_hostname, $phpThumb->config_mysql_username, $phpThumb->config_mysql_password)) {
345 345
                 if (@mysqli_select_db($GLOBALS['xoopsDB']->conn, $phpThumb->config_mysql_database, $cid)) {
@@ -356,11 +356,11 @@  discard block
 block discarded – undo
356 356
                         }
357 357
                     } else {
358 358
                         $GLOBALS['xoopsDB']->close($cid);
359
-                        $phpThumb->ErrorImage('Error in MySQL query: "' . $GLOBALS['xoopsDB']->error($cid) . '"');
359
+                        $phpThumb->ErrorImage('Error in MySQL query: "'.$GLOBALS['xoopsDB']->error($cid).'"');
360 360
                     }
361 361
                 } else {
362 362
                     $GLOBALS['xoopsDB']->close($cid);
363
-                    $phpThumb->ErrorImage('cannot select MySQL database: "' . $GLOBALS['xoopsDB']->error($cid) . '"');
363
+                    $phpThumb->ErrorImage('cannot select MySQL database: "'.$GLOBALS['xoopsDB']->error($cid).'"');
364 364
                 }
365 365
             } else {
366 366
                 $phpThumb->ErrorImage('cannot connect to MySQL server');
@@ -425,24 +425,24 @@  discard block
 block discarded – undo
425 425
 foreach ($_GET as $key => $value) {
426 426
     if (!empty($PHPTHUMB_DEFAULTS_DISABLEGETPARAMS) && ('src' !== $key)) {
427 427
         // disabled, do not set parameter
428
-        $phpThumb->DebugMessage('ignoring $_GET[' . $key . '] because of $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS', __FILE__, __LINE__);
428
+        $phpThumb->DebugMessage('ignoring $_GET['.$key.'] because of $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS', __FILE__, __LINE__);
429 429
     } elseif (in_array($key, $allowedGETparameters)) {
430
-        $phpThumb->DebugMessage('setParameter(' . $key . ', ' . $phpThumb->phpThumbDebugVarDump($value) . ')', __FILE__, __LINE__);
430
+        $phpThumb->DebugMessage('setParameter('.$key.', '.$phpThumb->phpThumbDebugVarDump($value).')', __FILE__, __LINE__);
431 431
         $phpThumb->setParameter($key, $value);
432 432
     } else {
433
-        $phpThumb->ErrorImage('Forbidden parameter: ' . $key);
433
+        $phpThumb->ErrorImage('Forbidden parameter: '.$key);
434 434
     }
435 435
 }
436 436
 
437 437
 if (!empty($PHPTHUMB_DEFAULTS) && is_array($PHPTHUMB_DEFAULTS)) {
438
-    $phpThumb->DebugMessage('setting $PHPTHUMB_DEFAULTS[' . implode(';', array_keys($PHPTHUMB_DEFAULTS)) . ']', __FILE__, __LINE__);
438
+    $phpThumb->DebugMessage('setting $PHPTHUMB_DEFAULTS['.implode(';', array_keys($PHPTHUMB_DEFAULTS)).']', __FILE__, __LINE__);
439 439
     foreach ($PHPTHUMB_DEFAULTS as $key => $value) {
440 440
         if (!$PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE
441 441
             || !isset($_GET[$key])) { // set parameter to default value if config is set to allow _GET to override default, OR if no value is passed via _GET for this parameter
442 442
             //$_GET[$key] = $value;
443 443
             //$phpThumb->DebugMessage('PHPTHUMB_DEFAULTS assigning ('.(is_array($value) ? print_r($value, true) : $value).') to $_GET['.$key.']', __FILE__, __LINE__);
444 444
             $phpThumb->setParameter($key, $value);
445
-            $phpThumb->DebugMessage('setParameter(' . $key . ', ' . $phpThumb->phpThumbDebugVarDump($value) . ') from $PHPTHUMB_DEFAULTS', __FILE__, __LINE__);
445
+            $phpThumb->DebugMessage('setParameter('.$key.', '.$phpThumb->phpThumbDebugVarDump($value).') from $PHPTHUMB_DEFAULTS', __FILE__, __LINE__);
446 446
         }
447 447
     }
448 448
 }
@@ -474,13 +474,13 @@  discard block
 block discarded – undo
474 474
 } elseif (preg_match('#^http\://[^\\?&]+\\.(jpe?g|gif|png)$#i', $phpThumb->src)) {
475 475
     // assume is ok to passthru if no other parameters specified
476 476
 } elseif (preg_match('#^(f|ht)tp\://#i', $phpThumb->src)) {
477
-    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because preg_match("#^(f|ht)tp\://#i", ' . $phpThumb->src . ')', __FILE__, __LINE__);
477
+    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because preg_match("#^(f|ht)tp\://#i", '.$phpThumb->src.')', __FILE__, __LINE__);
478 478
     $CanPassThroughDirectly = false;
479 479
 } elseif (!@is_readable($phpThumb->sourceFilename)) {
480
-    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_readable(' . $phpThumb->sourceFilename . ')', __FILE__, __LINE__);
480
+    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_readable('.$phpThumb->sourceFilename.')', __FILE__, __LINE__);
481 481
     $CanPassThroughDirectly = false;
482 482
 } elseif (!@is_file($phpThumb->sourceFilename)) {
483
-    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_file(' . $phpThumb->sourceFilename . ')', __FILE__, __LINE__);
483
+    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_file('.$phpThumb->sourceFilename.')', __FILE__, __LINE__);
484 484
     $CanPassThroughDirectly = false;
485 485
 }
486 486
 foreach ($_GET as $key => $value) {
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
     }
512 512
 }
513 513
 if (!empty($UnAllowedGET)) {
514
-    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because $_GET[' . implode(';', array_unique($UnAllowedGET)) . '] are set', __FILE__, __LINE__);
514
+    $phpThumb->DebugMessage('$CanPassThroughDirectly=false because $_GET['.implode(';', array_unique($UnAllowedGET)).'] are set', __FILE__, __LINE__);
515 515
 }
516 516
 
517 517
 ////////////////////////////////////////////////////////////////
@@ -522,13 +522,13 @@  discard block
 block discarded – undo
522 522
 }
523 523
 ////////////////////////////////////////////////////////////////
524 524
 
525
-$phpThumb->DebugMessage('$CanPassThroughDirectly="' . (int)$CanPassThroughDirectly . '" && $phpThumb->src="' . $phpThumb->src . '"', __FILE__, __LINE__);
525
+$phpThumb->DebugMessage('$CanPassThroughDirectly="'.(int)$CanPassThroughDirectly.'" && $phpThumb->src="'.$phpThumb->src.'"', __FILE__, __LINE__);
526 526
 while ($CanPassThroughDirectly && $phpThumb->src) {
527 527
     // no parameters set, passthru
528 528
 
529 529
     if (preg_match('#^http\://[^\\?&]+\.(jpe?g|gif|png)$#i', $phpThumb->src)) {
530
-        $phpThumb->DebugMessage('Passing HTTP source through directly as Location: redirect (' . $phpThumb->src . ')', __FILE__, __LINE__);
531
-        header('Location: ' . $phpThumb->src);
530
+        $phpThumb->DebugMessage('Passing HTTP source through directly as Location: redirect ('.$phpThumb->src.')', __FILE__, __LINE__);
531
+        header('Location: '.$phpThumb->src);
532 532
         exit;
533 533
     }
534 534
 
@@ -536,20 +536,20 @@  discard block
 block discarded – undo
536 536
 
537 537
     // security and size checks
538 538
     if ($phpThumb->getimagesizeinfo = @getimagesize($SourceFilename)) {
539
-        $phpThumb->DebugMessage('Direct passthru getimagesize() returned [w=' . $phpThumb->getimagesizeinfo[0] . ';h=' . $phpThumb->getimagesizeinfo[1] . ';t=' . $phpThumb->getimagesizeinfo[2] . ']', __FILE__, __LINE__);
539
+        $phpThumb->DebugMessage('Direct passthru getimagesize() returned [w='.$phpThumb->getimagesizeinfo[0].';h='.$phpThumb->getimagesizeinfo[1].';t='.$phpThumb->getimagesizeinfo[2].']', __FILE__, __LINE__);
540 540
 
541 541
         if (!@$_GET['w'] && !@$_GET['wp'] && !@$_GET['wl'] && !@$_GET['ws'] && !@$_GET['h'] && !@$_GET['hp']
542 542
             && !@$_GET['hl']
543 543
             && !@$_GET['hs']) {
544 544
             // no resizing needed
545
-            $phpThumb->DebugMessage('Passing "' . $SourceFilename . '" through directly, no resizing required ("' . $phpThumb->getimagesizeinfo[0] . '"x"' . $phpThumb->getimagesizeinfo[1] . '")', __FILE__, __LINE__);
545
+            $phpThumb->DebugMessage('Passing "'.$SourceFilename.'" through directly, no resizing required ("'.$phpThumb->getimagesizeinfo[0].'"x"'.$phpThumb->getimagesizeinfo[1].'")', __FILE__, __LINE__);
546 546
         } elseif (($phpThumb->getimagesizeinfo[0] <= @$_GET['w']) && ($phpThumb->getimagesizeinfo[1] <= @$_GET['h'])
547 547
                   && ((@$_GET['w'] == $phpThumb->getimagesizeinfo[0])
548 548
                       || (@$_GET['h'] == $phpThumb->getimagesizeinfo[1]))) {
549 549
             // image fits into 'w'x'h' box, and at least one dimension matches exactly, therefore no resizing needed
550
-            $phpThumb->DebugMessage('Passing "' . $SourceFilename . '" through directly, no resizing required ("' . $phpThumb->getimagesizeinfo[0] . '"x"' . $phpThumb->getimagesizeinfo[1] . '" fits inside "' . @$_GET['w'] . '"x"' . @$_GET['h'] . '")', __FILE__, __LINE__);
550
+            $phpThumb->DebugMessage('Passing "'.$SourceFilename.'" through directly, no resizing required ("'.$phpThumb->getimagesizeinfo[0].'"x"'.$phpThumb->getimagesizeinfo[1].'" fits inside "'.@$_GET['w'].'"x"'.@$_GET['h'].'")', __FILE__, __LINE__);
551 551
         } else {
552
-            $phpThumb->DebugMessage('Not passing "' . $SourceFilename . '" through directly because resizing required (from "' . $phpThumb->getimagesizeinfo[0] . '"x"' . $phpThumb->getimagesizeinfo[1] . '" to "' . @$_GET['w'] . '"x"' . @$_GET['h'] . '")', __FILE__, __LINE__);
552
+            $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because resizing required (from "'.$phpThumb->getimagesizeinfo[0].'"x"'.$phpThumb->getimagesizeinfo[1].'" to "'.@$_GET['w'].'"x"'.@$_GET['h'].'")', __FILE__, __LINE__);
553 553
             break;
554 554
         }
555 555
         switch ($phpThumb->getimagesizeinfo[2]) {
@@ -560,11 +560,11 @@  discard block
 block discarded – undo
560 560
                 break;
561 561
             default:
562 562
                 // browser probably can't handle format, remangle it to JPEG/PNG/GIF
563
-                $phpThumb->DebugMessage('Not passing "' . $SourceFilename . '" through directly because $phpThumb->getimagesizeinfo[2] = "' . $phpThumb->getimagesizeinfo[2] . '"', __FILE__, __LINE__);
563
+                $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because $phpThumb->getimagesizeinfo[2] = "'.$phpThumb->getimagesizeinfo[2].'"', __FILE__, __LINE__);
564 564
                 break 2;
565 565
         }
566 566
 
567
-        $ImageCreateFunctions   = [
567
+        $ImageCreateFunctions = [
568 568
             1 => 'imagecreatefromgif',
569 569
             2 => 'imagecreatefromjpeg',
570 570
             3 => 'imagecreatefrompng'
@@ -581,28 +581,28 @@  discard block
 block discarded – undo
581 581
             }
582 582
 
583 583
             if (headers_sent()) {
584
-                $phpThumb->ErrorImage('Headers already sent (' . basename(__FILE__) . ' line ' . __LINE__ . ')');
584
+                $phpThumb->ErrorImage('Headers already sent ('.basename(__FILE__).' line '.__LINE__.')');
585 585
                 exit;
586 586
             }
587 587
            if (\Xmf\Request::hasVar('phpThumbDebug', 'GET')) {
588 588
                 $phpThumb->DebugTimingMessage('skipped direct $SourceFilename passthru', __FILE__, __LINE__);
589
-                $phpThumb->DebugMessage('Would have passed "' . $SourceFilename . '" through directly, but skipping due to phpThumbDebug', __FILE__, __LINE__);
589
+                $phpThumb->DebugMessage('Would have passed "'.$SourceFilename.'" through directly, but skipping due to phpThumbDebug', __FILE__, __LINE__);
590 590
                 break;
591 591
             }
592 592
 
593 593
             SendSaveAsFileHeaderIfNeeded();
594
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s', @filemtime($SourceFilename)) . ' GMT');
594
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s', @filemtime($SourceFilename)).' GMT');
595 595
             if ($contentType = phpthumb_functions::ImageTypeToMIMEtype(@$phpThumb->getimagesizeinfo[2])) {
596
-                header('Content-Type: ' . $contentType);
596
+                header('Content-Type: '.$contentType);
597 597
             }
598 598
             @readfile($SourceFilename);
599 599
             exit;
600 600
         } else {
601
-            $phpThumb->DebugMessage('Not passing "' . $SourceFilename . '" through directly because ($phpThumb->config_disable_onlycreateable_passthru = "' . $phpThumb->config_disable_onlycreateable_passthru . '") and ' . $theImageCreateFunction . '() failed', __FILE__, __LINE__);
601
+            $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because ($phpThumb->config_disable_onlycreateable_passthru = "'.$phpThumb->config_disable_onlycreateable_passthru.'") and '.$theImageCreateFunction.'() failed', __FILE__, __LINE__);
602 602
             break;
603 603
         }
604 604
     } else {
605
-        $phpThumb->DebugMessage('Not passing "' . $SourceFilename . '" through directly because getimagesize() failed', __FILE__, __LINE__);
605
+        $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because getimagesize() failed', __FILE__, __LINE__);
606 606
         break;
607 607
     }
608 608
     break;
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
 if (@is_readable($phpThumb->cache_filename)) {
622 622
     RedirectToCachedFile();
623 623
 } else {
624
-    $phpThumb->DebugMessage('Cached file "' . $phpThumb->cache_filename . '" does not exist, processing as normal', __FILE__, __LINE__);
624
+    $phpThumb->DebugMessage('Cached file "'.$phpThumb->cache_filename.'" does not exist, processing as normal', __FILE__, __LINE__);
625 625
 }
626 626
 
627 627
 ////////////////////////////////////////////////////////////////
@@ -656,30 +656,30 @@  discard block
 block discarded – undo
656 656
         $new_background_color = phpthumb_functions::ImageHexColorAllocate($phpThumb->gdimg_source, $bghexcolor, false, $alpha);
657 657
         imagefilledrectangle($phpThumb->gdimg_source, 0, 0, $phpThumb->w, $phpThumb->h, $new_background_color);
658 658
     } else {
659
-        $phpThumb->ErrorImage('failed to create "new" image (' . $phpThumb->w . 'x' . $phpThumb->h . ')');
659
+        $phpThumb->ErrorImage('failed to create "new" image ('.$phpThumb->w.'x'.$phpThumb->h.')');
660 660
     }
661 661
 } elseif (!$phpThumb->src) {
662
-    $phpThumb->ErrorImage('Usage: ' . $_SERVER['PHP_SELF'] . '?src=/path/and/filename.jpg' . "\n" . 'read Usage comments for details');
662
+    $phpThumb->ErrorImage('Usage: '.$_SERVER['PHP_SELF'].'?src=/path/and/filename.jpg'."\n".'read Usage comments for details');
663 663
 } elseif (preg_match('#^([a-z0-9]+)://#i', $_GET['src'], $protocol_matches)) {
664 664
     if (preg_match('#^(f|ht)tps?://#i', $_GET['src'])) {
665
-        $phpThumb->DebugMessage('$phpThumb->src (' . $phpThumb->src . ') is remote image, attempting to download', __FILE__, __LINE__);
665
+        $phpThumb->DebugMessage('$phpThumb->src ('.$phpThumb->src.') is remote image, attempting to download', __FILE__, __LINE__);
666 666
         if ($phpThumb->config_http_user_agent) {
667
-            $phpThumb->DebugMessage('Setting "user_agent" to "' . $phpThumb->config_http_user_agent . '"', __FILE__, __LINE__);
667
+            $phpThumb->DebugMessage('Setting "user_agent" to "'.$phpThumb->config_http_user_agent.'"', __FILE__, __LINE__);
668 668
             ini_set('user_agent', $phpThumb->config_http_user_agent);
669 669
         }
670 670
         $cleanedupurl = phpthumb_functions::CleanUpURLencoding($phpThumb->src);
671
-        $phpThumb->DebugMessage('CleanUpURLencoding(' . $phpThumb->src . ') returned "' . $cleanedupurl . '"', __FILE__, __LINE__);
671
+        $phpThumb->DebugMessage('CleanUpURLencoding('.$phpThumb->src.') returned "'.$cleanedupurl.'"', __FILE__, __LINE__);
672 672
         $phpThumb->src = $cleanedupurl;
673 673
         unset($cleanedupurl);
674 674
         if ($rawImageData = phpthumb_functions::SafeURLread($phpThumb->src, $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) {
675
-            $phpThumb->DebugMessage('SafeURLread(' . $phpThumb->src . ') succeeded' . ($error ? ' with messsages: "' . $error . '"' : ''), __FILE__, __LINE__);
676
-            $phpThumb->DebugMessage('Setting source data from URL "' . $phpThumb->src . '"', __FILE__, __LINE__);
675
+            $phpThumb->DebugMessage('SafeURLread('.$phpThumb->src.') succeeded'.($error ? ' with messsages: "'.$error.'"' : ''), __FILE__, __LINE__);
676
+            $phpThumb->DebugMessage('Setting source data from URL "'.$phpThumb->src.'"', __FILE__, __LINE__);
677 677
             $phpThumb->setSourceData($rawImageData, urlencode($phpThumb->src));
678 678
         } else {
679 679
             $phpThumb->ErrorImage($error);
680 680
         }
681 681
     } else {
682
-        $phpThumb->ErrorImage('only FTP and HTTP/HTTPS protocols are allowed, "' . $protocol_matches[1] . '" is not');
682
+        $phpThumb->ErrorImage('only FTP and HTTP/HTTPS protocols are allowed, "'.$protocol_matches[1].'" is not');
683 683
     }
684 684
 }
685 685
 
@@ -714,10 +714,10 @@  discard block
 block discarded – undo
714 714
             chmod($phpThumb->cache_filename, 0644);
715 715
             RedirectToCachedFile();
716 716
         } else {
717
-            $phpThumb->DebugMessage('Failed: RenderToFile(' . $phpThumb->cache_filename . ')', __FILE__, __LINE__);
717
+            $phpThumb->DebugMessage('Failed: RenderToFile('.$phpThumb->cache_filename.')', __FILE__, __LINE__);
718 718
         }
719 719
     } else {
720
-        $phpThumb->DebugMessage('Cannot write to $phpThumb->cache_filename (' . $phpThumb->cache_filename . ') because that directory (' . dirname($phpThumb->cache_filename) . ') is not writable', __FILE__, __LINE__);
720
+        $phpThumb->DebugMessage('Cannot write to $phpThumb->cache_filename ('.$phpThumb->cache_filename.') because that directory ('.dirname($phpThumb->cache_filename).') is not writable', __FILE__, __LINE__);
721 721
     }
722 722
 }
723 723
 
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 ////////////////////////////////////////////////////////////////
731 731
 
732 732
 if (!$phpThumb->OutputThumbnail()) {
733
-    $phpThumb->ErrorImage('Error in OutputThumbnail():' . "\n" . $phpThumb->debugmessages[count($phpThumb->debugmessages) - 1]);
733
+    $phpThumb->ErrorImage('Error in OutputThumbnail():'."\n".$phpThumb->debugmessages[count($phpThumb->debugmessages) - 1]);
734 734
 }
735 735
 
736 736
 ////////////////////////////////////////////////////////////////
Please login to merge, or discard this patch.
phpthumb/phpthumb.gif.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 {
142 142
     // JPEG output that does not require cjpeg added by James Heinrich <[email protected]> - December 10, 2003
143 143
     if (('WIN' !== strtoupper(substr(PHP_OS, 0, 3))) && (file_exists('/usr/local/bin/cjpeg') || shell_exec('which cjpeg'))) {
144
-        if (gif_outputAsBmp($gif, $lpszFileName . '.bmp', $bgColor)) {
145
-            exec('cjpeg ' . $lpszFileName . '.bmp >' . $lpszFileName . ' 2>/dev/null');
146
-            @unlink($lpszFileName . '.bmp');
144
+        if (gif_outputAsBmp($gif, $lpszFileName.'.bmp', $bgColor)) {
145
+            exec('cjpeg '.$lpszFileName.'.bmp >'.$lpszFileName.' 2>/dev/null');
146
+            @unlink($lpszFileName.'.bmp');
147 147
 
148 148
             if (@file_exists($lpszFileName)) {
149 149
                 if (@filesize($lpszFileName) > 0) {
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
         $ret = '';
501 501
 
502 502
         for ($i = 0; $i < $this->m_nColors; $i++) {
503
-            $ret .= chr($this->m_arColors[$i] & 0x000000FF) . // R
504
-                    chr(($this->m_arColors[$i] & 0x0000FF00) >> 8) . // G
505
-                    chr(($this->m_arColors[$i] & 0x00FF0000) >> 16);  // B
503
+            $ret .= chr($this->m_arColors[$i] & 0x000000FF).// R
504
+                    chr(($this->m_arColors[$i] & 0x0000FF00) >> 8).// G
505
+                    chr(($this->m_arColors[$i] & 0x00FF0000) >> 16); // B
506 506
         }
507 507
 
508 508
         return $ret;
@@ -518,9 +518,9 @@  discard block
 block discarded – undo
518 518
         $ret = '';
519 519
 
520 520
         for ($i = 0; $i < $this->m_nColors; $i++) {
521
-            $ret .= chr(($this->m_arColors[$i] & 0x00FF0000) >> 16) . // B
522
-                    chr(($this->m_arColors[$i] & 0x0000FF00) >> 8) . // G
523
-                    chr($this->m_arColors[$i] & 0x000000FF) . // R
521
+            $ret .= chr(($this->m_arColors[$i] & 0x00FF0000) >> 16).// B
522
+                    chr(($this->m_arColors[$i] & 0x0000FF00) >> 8).// G
523
+                    chr($this->m_arColors[$i] & 0x000000FF).// R
524 524
                     "\x00";
525 525
         }
526 526
 
@@ -791,14 +791,14 @@  discard block
 block discarded – undo
791 791
                     if (!$this->m_gih->load($data, $len = 0)) {
792 792
                         return false;
793 793
                     }
794
-                    $data   = substr($data, $len);
794
+                    $data = substr($data, $len);
795 795
                     $datLen += $len;
796 796
 
797 797
                     // ALLOC BUFFER
798 798
                     if (!($this->m_data = $this->m_lzw->deCompress($data, $len = 0))) {
799 799
                         return false;
800 800
                     }
801
-                    $data   = substr($data, $len);
801
+                    $data = substr($data, $len);
802 802
                     $datLen += $len;
803 803
 
804 804
                     if ($this->m_gih->m_bInterlace) {
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
                 $lne          = substr($this->m_data, 0, $this->m_gih->m_nWidth);
914 914
                 $this->m_data = substr($this->m_data, $this->m_gih->m_nWidth);
915 915
 
916
-                $data = substr($data, 0, $y * $this->m_gih->m_nWidth) . $lne . substr($data, ($y + 1) * $this->m_gih->m_nWidth);
916
+                $data = substr($data, 0, $y * $this->m_gih->m_nWidth).$lne.substr($data, ($y + 1) * $this->m_gih->m_nWidth);
917 917
             }
918 918
         }
919 919
 
@@ -1286,7 +1286,7 @@  discard block
 block discarded – undo
1286 1286
     {
1287 1287
         $val = (int)$val;
1288 1288
 
1289
-        return chr($val & 0xFF) . chr(($val & 0xFF00) >> 8) . chr(($val & 0xFF0000) >> 16) . chr(($val & 0xFF000000) >> 24);
1289
+        return chr($val & 0xFF).chr(($val & 0xFF00) >> 8).chr(($val & 0xFF0000) >> 16).chr(($val & 0xFF000000) >> 24);
1290 1290
     }
1291 1291
 
1292 1292
     ///////////////////////////////////////////////////////////////////////////
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
     {
1300 1300
         $val = (int)$val;
1301 1301
 
1302
-        return chr(($val & 0xFF000000) >> 24) . chr(($val & 0xFF0000) >> 16) . chr(($val & 0xFF00) >> 8) . chr($val & 0xFF);
1302
+        return chr(($val & 0xFF000000) >> 24).chr(($val & 0xFF0000) >> 16).chr(($val & 0xFF00) >> 8).chr($val & 0xFF);
1303 1303
     }
1304 1304
 
1305 1305
     ///////////////////////////////////////////////////////////////////////////
Please login to merge, or discard this patch.
phpthumb/phpThumb.config.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 //            THIS CONFIG FILE ONLY APPLIES TO phpThumb.php //
10 10
 //                                                         ///
11 11
 //////////////////////////////////////////////////////////////
12
-require dirname(dirname(__DIR__)) . '/header.php';
12
+require dirname(dirname(__DIR__)).'/header.php';
13 13
 ob_start();
14
-if (!file_exists(__DIR__ . '/phpthumb.functions.php') || !require_once __DIR__ . '/phpthumb.functions.php') {
14
+if (!file_exists(__DIR__.'/phpthumb.functions.php') || !require_once __DIR__.'/phpthumb.functions.php') {
15 15
     ob_end_flush();
16
-    die('failed to include_once(phpthumb.functions.php) - realpath="' . realpath(__DIR__ . '/phpthumb.functions.php') . '"');
16
+    die('failed to include_once(phpthumb.functions.php) - realpath="'.realpath(__DIR__.'/phpthumb.functions.php').'"');
17 17
 }
18 18
 ob_end_clean();
19 19
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 // * Cache directory configuration (choose only one of these - leave the other lines commented-out):
33 33
 // Note: this directory must be writable (usually chmod 777 is neccesary) for caching to work.
34 34
 // If the directory is not writable no error will be generated but caching will be disabled.
35
-$PHPTHUMB_CONFIG['cache_directory'] = XOOPS_CACHE_PATH;                            // set the cache directory relative to the phpThumb() installation
35
+$PHPTHUMB_CONFIG['cache_directory'] = XOOPS_CACHE_PATH; // set the cache directory relative to the phpThumb() installation
36 36
 //$PHPTHUMB_CONFIG['cache_directory'] = $PHPTHUMB_CONFIG['document_root'].'/phpthumb/cache/'; // set the cache directory to an absolute directory for all source images
37 37
 //$PHPTHUMB_CONFIG['cache_directory'] = './cache/';                                           // set the cache directory relative to the source image - must start with '.' (will not work to cache URL- or database-sourced images, please use an absolute directory name)
38 38
 //$PHPTHUMB_CONFIG['cache_directory'] = null;                                                 // disable thumbnail caching (not recommended)
@@ -50,35 +50,35 @@  discard block
 block discarded – undo
50 50
 //   based on last-access date and/or number of files and/or total filesize.
51 51
 
52 52
 //$PHPTHUMB_CONFIG['cache_maxage'] = null;            // never delete cached thumbnails based on last-access time
53
-$PHPTHUMB_CONFIG['cache_maxage'] = 86400 * 30;        // delete cached thumbnails that haven't been accessed in more than [30 days] (value is maximum time since last access in seconds to avoid deletion)
53
+$PHPTHUMB_CONFIG['cache_maxage'] = 86400 * 30; // delete cached thumbnails that haven't been accessed in more than [30 days] (value is maximum time since last access in seconds to avoid deletion)
54 54
 
55 55
 //$PHPTHUMB_CONFIG['cache_maxsize'] = null;           // never delete cached thumbnails based on byte size of cache directory
56 56
 $PHPTHUMB_CONFIG['cache_maxsize'] = 10 * 1024 * 1024; // delete least-recently-accessed cached thumbnails when more than [10MB] of cached files are present (value is maximum bytesize of all cached files)
57 57
 
58 58
 //$PHPTHUMB_CONFIG['cache_maxfiles'] = null;          // never delete cached thumbnails based on number of cached files
59
-$PHPTHUMB_CONFIG['cache_maxfiles'] = 200;             // delete least-recently-accessed cached thumbnails when more than [200] cached files are present (value is maximum number of cached files to keep)
59
+$PHPTHUMB_CONFIG['cache_maxfiles'] = 200; // delete least-recently-accessed cached thumbnails when more than [200] cached files are present (value is maximum number of cached files to keep)
60 60
 
61 61
 // * Source image cache configuration
62
-$PHPTHUMB_CONFIG['cache_source_enabled']   = true;                               // if true, source images obtained via HTTP are cached to $PHPTHUMB_CONFIG['cache_source_directory']
63
-$PHPTHUMB_CONFIG['cache_source_directory'] = XOOPS_CACHE_PATH;  // set the cache directory for unprocessed source images
62
+$PHPTHUMB_CONFIG['cache_source_enabled']   = true; // if true, source images obtained via HTTP are cached to $PHPTHUMB_CONFIG['cache_source_directory']
63
+$PHPTHUMB_CONFIG['cache_source_directory'] = XOOPS_CACHE_PATH; // set the cache directory for unprocessed source images
64 64
 
65 65
 // * cache source modification date configuration
66 66
 $PHPTHUMB_CONFIG['cache_source_filemtime_ignore_local']  = false; // if true, local source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed
67
-$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] = true;  // if true, remote source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed. WARNING: cached performance MUCH slower if this is set to false.
67
+$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] = true; // if true, remote source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed. WARNING: cached performance MUCH slower if this is set to false.
68 68
 
69 69
 // * Simplified cache filename configuration
70 70
 // Instead of creating unique cache filenames for all parameter combinations, create "simple" cache files (eg: "pic_thumb.jpg")
71 71
 // If cache_default_only_suffix is non-empty, GETstring parameters (except 'src') are ignored and only $PHPTHUMB_DEFAULTS
72 72
 // parameters (set at the bottom of phpThumb.config.php) are used for processing.
73 73
 // The '*' character MUST be used to represent the source image name
74
-$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '';           // cached in normal phpThumb manner
74
+$PHPTHUMB_CONFIG['cache_default_only_suffix'] = ''; // cached in normal phpThumb manner
75 75
 //$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '*_thumb';  // cache 'pic.jpg' becomes 'pic_thumb.jpg' (or 'pic_thumb.png' if PNG output is selected, etc)
76 76
 //$PHPTHUMB_CONFIG['cache_default_only_suffix'] = 'small-*';  // cache 'pic.jpg' becomes 'small-pic.jpg' (or 'small-pic.png' if PNG output is selected, etc)
77 77
 
78
-$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_' . (isset($_SERVER['SERVER_NAME']) ? str_replace('www.', '', $_SERVER['SERVER_NAME']) . '_' : ''); // keep cache file separate by domain
78
+$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_'.(isset($_SERVER['SERVER_NAME']) ? str_replace('www.', '', $_SERVER['SERVER_NAME']).'_' : ''); // keep cache file separate by domain
79 79
 //$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache';                                                                                             // allow phpThumb to share 1 set of cached files even if accessed under different servername/domains on same server
80 80
 
81
-$PHPTHUMB_CONFIG['cache_force_passthru'] = true;  // if true, cached image data will always be passed to browser; if false, HTTP redirect will be used instead
81
+$PHPTHUMB_CONFIG['cache_force_passthru'] = true; // if true, cached image data will always be passed to browser; if false, HTTP redirect will be used instead
82 82
 
83 83
 // * Temp directory configuration
84 84
 // phpThumb() may need to create temp files. Usually the system temp dir is writable and can be used.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 // you should change this to a full pathname to a directory you do have write access to.
87 87
 //$PHPTHUMB_CONFIG['temp_directory'] = null;                               // attempt to auto-detect
88 88
 //$PHPTHUMB_CONFIG['temp_directory'] = '/tmp/persistent/phpthumb/cache/';  // set to absolute path
89
-$PHPTHUMB_CONFIG['temp_directory'] = $PHPTHUMB_CONFIG['cache_directory'];  // set to same as cache directory
89
+$PHPTHUMB_CONFIG['temp_directory'] = $PHPTHUMB_CONFIG['cache_directory']; // set to same as cache directory
90 90
 
91 91
 // NOTE: "max_source_pixels" only affects GD-resized thumbnails. If you have ImageMagick
92 92
 //       installed it will bypass most of these limits
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 if (phpthumb_functions::version_compare_replacement(PHP_VERSION, '4.3.2', '>=') && !defined('memory_get_usage')
105 105
     && !@ini_get('memory_limit')) {
106 106
     // memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option.
107
-    $PHPTHUMB_CONFIG['max_source_pixels'] = 0;         // no memory limit
107
+    $PHPTHUMB_CONFIG['max_source_pixels'] = 0; // no memory limit
108 108
 } else {
109 109
     // calculate default max_source_pixels as 1/6 of memory limit configuration
110 110
     $PHPTHUMB_CONFIG['max_source_pixels'] = round(max((int)ini_get('memory_limit'), (int)get_cfg_var('memory_limit')) * 1048576 / 6);
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 }
116 116
 
117 117
 // ImageMagick configuration
118
-$PHPTHUMB_CONFIG['prefer_imagemagick']        = true;  // If true, use ImageMagick to resize thumbnails if possible, since it is usually faster than GD functions; if false only use ImageMagick if PHP memory limit is too low.
119
-$PHPTHUMB_CONFIG['imagemagick_use_thumbnail'] = true;  // If true, use ImageMagick's "-thumbnail" resizing parameter (if available) which removes extra non-image metadata (profiles, EXIF info, etc) resulting in much smaller filesize; if false, use "-resize" paramter which retains this info
118
+$PHPTHUMB_CONFIG['prefer_imagemagick']        = true; // If true, use ImageMagick to resize thumbnails if possible, since it is usually faster than GD functions; if false only use ImageMagick if PHP memory limit is too low.
119
+$PHPTHUMB_CONFIG['imagemagick_use_thumbnail'] = true; // If true, use ImageMagick's "-thumbnail" resizing parameter (if available) which removes extra non-image metadata (profiles, EXIF info, etc) resulting in much smaller filesize; if false, use "-resize" paramter which retains this info
120 120
 if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
121 121
     // Windows: set absolute pathname
122 122
     $PHPTHUMB_CONFIG['imagemagick_path'] = 'C:/ImageMagick/convert.exe';
@@ -128,41 +128,41 @@  discard block
 block discarded – undo
128 128
 
129 129
 // * Default output configuration:
130 130
 $PHPTHUMB_CONFIG['output_format']    = 'png'; // default output format ('jpeg', 'png' or 'gif') - thumbnail will be output in this format (if available in your version of GD or ImageMagick). This is only used if the "f" parameter is not specified, and if the thumbnail can't be output in the input format.
131
-$PHPTHUMB_CONFIG['output_maxwidth']  = 0;      // default maximum thumbnail width.  If this is zero then default width  is the width  of the source image. This is always overridden by ?w=___ GETstring parameter
132
-$PHPTHUMB_CONFIG['output_maxheight'] = 0;      // default maximum thumbnail height. If this is zero then default height is the height of the source image. This is always overridden by ?h=___ GETstring parameter
133
-$PHPTHUMB_CONFIG['output_interlace'] = true;   // if true: interlaced output for GIF/PNG, progressive output for JPEG; if false: non-interlaced for GIF/PNG, baseline for JPEG.
131
+$PHPTHUMB_CONFIG['output_maxwidth']  = 0; // default maximum thumbnail width.  If this is zero then default width  is the width  of the source image. This is always overridden by ?w=___ GETstring parameter
132
+$PHPTHUMB_CONFIG['output_maxheight'] = 0; // default maximum thumbnail height. If this is zero then default height is the height of the source image. This is always overridden by ?h=___ GETstring parameter
133
+$PHPTHUMB_CONFIG['output_interlace'] = true; // if true: interlaced output for GIF/PNG, progressive output for JPEG; if false: non-interlaced for GIF/PNG, baseline for JPEG.
134 134
 
135 135
 // * Error message configuration
136
-$PHPTHUMB_CONFIG['error_image_width']           = 300;      // default width for error images
137
-$PHPTHUMB_CONFIG['error_image_height']          = 100;      // default height for error images
138
-$PHPTHUMB_CONFIG['error_message_image_default'] = '';       // Set this to the name of a generic error image (e.g. '/images/error.png') that you want displayed in place of any error message that may occur. This setting is overridden by the 'err' parameter, which does the same thing.
136
+$PHPTHUMB_CONFIG['error_image_width']           = 300; // default width for error images
137
+$PHPTHUMB_CONFIG['error_image_height']          = 100; // default height for error images
138
+$PHPTHUMB_CONFIG['error_message_image_default'] = ''; // Set this to the name of a generic error image (e.g. '/images/error.png') that you want displayed in place of any error message that may occur. This setting is overridden by the 'err' parameter, which does the same thing.
139 139
 $PHPTHUMB_CONFIG['error_bgcolor']               = 'CCCCFF'; // background color of error message images
140 140
 $PHPTHUMB_CONFIG['error_textcolor']             = 'FF0000'; // color of text in error messages
141
-$PHPTHUMB_CONFIG['error_fontsize']              = 1;        // size of text in error messages, from 1 (smallest) to 5 (largest)
142
-$PHPTHUMB_CONFIG['error_die_on_error']          = true;     // die with error message on any fatal error (recommended with standalone phpThumb.php)
143
-$PHPTHUMB_CONFIG['error_silent_die_on_error']   = false;    // simply die with no output of any kind on fatal errors (not recommended)
144
-$PHPTHUMB_CONFIG['error_die_on_source_failure'] = true;     // die with error message if source image cannot be processed by phpThumb() (usually because source image is corrupt in some way). If false the source image will be passed through unprocessed, if true (default) an error message will be displayed.
141
+$PHPTHUMB_CONFIG['error_fontsize']              = 1; // size of text in error messages, from 1 (smallest) to 5 (largest)
142
+$PHPTHUMB_CONFIG['error_die_on_error']          = true; // die with error message on any fatal error (recommended with standalone phpThumb.php)
143
+$PHPTHUMB_CONFIG['error_silent_die_on_error']   = false; // simply die with no output of any kind on fatal errors (not recommended)
144
+$PHPTHUMB_CONFIG['error_die_on_source_failure'] = true; // die with error message if source image cannot be processed by phpThumb() (usually because source image is corrupt in some way). If false the source image will be passed through unprocessed, if true (default) an error message will be displayed.
145 145
 
146 146
 // * Off-server Thumbnailing Configuration:
147
-$PHPTHUMB_CONFIG['nohotlink_enabled']       = false;                                    // If false will allow thumbnailing from any source domain
148
-$PHPTHUMB_CONFIG['nohotlink_valid_domains'] = [@$_SERVER['HTTP_HOST']];            // This is the list of domains for which thumbnails are allowed to be created. Note: domain only, do not include port numbers. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format "www.example.com"
149
-$PHPTHUMB_CONFIG['nohotlink_erase_image']   = true;                                     // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
147
+$PHPTHUMB_CONFIG['nohotlink_enabled']       = false; // If false will allow thumbnailing from any source domain
148
+$PHPTHUMB_CONFIG['nohotlink_valid_domains'] = [@$_SERVER['HTTP_HOST']]; // This is the list of domains for which thumbnails are allowed to be created. Note: domain only, do not include port numbers. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format "www.example.com"
149
+$PHPTHUMB_CONFIG['nohotlink_erase_image']   = true; // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
150 150
 $PHPTHUMB_CONFIG['nohotlink_text_message']  = 'Off-server thumbnailing is not allowed'; // text of error message
151 151
 
152 152
 // * Off-server Linking Configuration:
153
-$PHPTHUMB_CONFIG['nooffsitelink_enabled']       = false;                                       // If false will allow thumbnails to be linked to from any domain, if true only domains listed below in 'nooffsitelink_valid_domains' will be allowed.
154
-$PHPTHUMB_CONFIG['nooffsitelink_valid_domains'] = [@$_SERVER['HTTP_HOST']];              // This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com'
155
-$PHPTHUMB_CONFIG['nooffsitelink_require_refer'] = false;                                      // If false will allow standalone calls to phpThumb(). If true then only requests with a Request::getString('HTTP_REFERER', '', 'SERVER') value in 'nooffsitelink_valid_domains' are allowed.
156
-$PHPTHUMB_CONFIG['nooffsitelink_erase_image']   = false;                                      // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
157
-$PHPTHUMB_CONFIG['nooffsitelink_watermark_src'] = '/demo/images/watermark.png';                // webroot-relative image to overlay on hotlinked images
158
-$PHPTHUMB_CONFIG['nooffsitelink_text_message']  = 'Image taken from ' . @$_SERVER['HTTP_HOST']; // text of error message (used if [nooffsitelink_watermark_src] is not a valid image)
153
+$PHPTHUMB_CONFIG['nooffsitelink_enabled']       = false; // If false will allow thumbnails to be linked to from any domain, if true only domains listed below in 'nooffsitelink_valid_domains' will be allowed.
154
+$PHPTHUMB_CONFIG['nooffsitelink_valid_domains'] = [@$_SERVER['HTTP_HOST']]; // This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com'
155
+$PHPTHUMB_CONFIG['nooffsitelink_require_refer'] = false; // If false will allow standalone calls to phpThumb(). If true then only requests with a Request::getString('HTTP_REFERER', '', 'SERVER') value in 'nooffsitelink_valid_domains' are allowed.
156
+$PHPTHUMB_CONFIG['nooffsitelink_erase_image']   = false; // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
157
+$PHPTHUMB_CONFIG['nooffsitelink_watermark_src'] = '/demo/images/watermark.png'; // webroot-relative image to overlay on hotlinked images
158
+$PHPTHUMB_CONFIG['nooffsitelink_text_message']  = 'Image taken from '.@$_SERVER['HTTP_HOST']; // text of error message (used if [nooffsitelink_watermark_src] is not a valid image)
159 159
 
160 160
 // * Border & Background default colors
161 161
 $PHPTHUMB_CONFIG['border_hexcolor']     = '000000'; // Default border color - usual HTML-style hex color notation (overridden with 'bc' parameter)
162 162
 $PHPTHUMB_CONFIG['background_hexcolor'] = 'FFFFFF'; // Default background color when thumbnail aspect ratio does not match fixed-dimension box - usual HTML-style hex color notation (overridden with 'bg' parameter)
163 163
 
164 164
 // * Watermark configuration
165
-$PHPTHUMB_CONFIG['ttf_directory'] = __DIR__ . '/fonts'; // Base directory for TTF font files
165
+$PHPTHUMB_CONFIG['ttf_directory'] = __DIR__.'/fonts'; // Base directory for TTF font files
166 166
 //$PHPTHUMB_CONFIG['ttf_directory'] = 'c:/windows/fonts';
167 167
 
168 168
 // * MySQL configuration
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 $PHPTHUMB_CONFIG['mysql_database'] = '';
181 181
 
182 182
 // * Security configuration
183
-$PHPTHUMB_CONFIG['high_security_enabled']    = false;  // if enabled, requires 'high_security_password' set to be set and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs
184
-$PHPTHUMB_CONFIG['high_security_password']   = '';     // required if 'high_security_enabled' is true, and must be at complex (uppercase, lowercase, numbers, punctuation, etc -- punctuation is strongest, lowercase is weakest; see PasswordStrength() in phpThumb.php). You can use a password generator like http://silisoftware.com/tools/password-random.php to generate a strong password
185
-$PHPTHUMB_CONFIG['disable_debug']            = true;   // prevent phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled
186
-$PHPTHUMB_CONFIG['allow_src_above_docroot']  = true;  // if true, allow src to be anywhere in filesystem; if false (default) only allow src within document_root
187
-$PHPTHUMB_CONFIG['allow_src_above_phpthumb'] = true;   // if true (default), allow src to be anywhere in filesystem; if false only allow src within sub-directory of phpThumb installation
188
-$PHPTHUMB_CONFIG['allow_parameter_file']     = false;  // if true, allow use of 'file' parameter; if false (default) the 'file' parameter is disabled/ignored
189
-$PHPTHUMB_CONFIG['allow_parameter_goto']     = false;  // if true, allow use of 'goto' parameter; if false (default) the 'goto' parameter is disabled/ignored
183
+$PHPTHUMB_CONFIG['high_security_enabled']    = false; // if enabled, requires 'high_security_password' set to be set and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs
184
+$PHPTHUMB_CONFIG['high_security_password']   = ''; // required if 'high_security_enabled' is true, and must be at complex (uppercase, lowercase, numbers, punctuation, etc -- punctuation is strongest, lowercase is weakest; see PasswordStrength() in phpThumb.php). You can use a password generator like http://silisoftware.com/tools/password-random.php to generate a strong password
185
+$PHPTHUMB_CONFIG['disable_debug']            = true; // prevent phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled
186
+$PHPTHUMB_CONFIG['allow_src_above_docroot']  = true; // if true, allow src to be anywhere in filesystem; if false (default) only allow src within document_root
187
+$PHPTHUMB_CONFIG['allow_src_above_phpthumb'] = true; // if true (default), allow src to be anywhere in filesystem; if false only allow src within sub-directory of phpThumb installation
188
+$PHPTHUMB_CONFIG['allow_parameter_file']     = false; // if true, allow use of 'file' parameter; if false (default) the 'file' parameter is disabled/ignored
189
+$PHPTHUMB_CONFIG['allow_parameter_goto']     = false; // if true, allow use of 'goto' parameter; if false (default) the 'goto' parameter is disabled/ignored
190 190
 
191 191
 // * HTTP UserAgent configuration
192 192
 //$PHPTHUMB_CONFIG['http_user_agent'] = '';                                                                                      // PHP default: none
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 $PHPTHUMB_CONFIG['http_user_agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7'; // Windows XP, Firefox
195 195
 
196 196
 // * Compatibility settings
197
-$PHPTHUMB_CONFIG['disable_pathinfo_parsing']        = false;  // if true, $_SERVER[PATH_INFO] is not parsed. May be needed on some server configurations to allow normal behavior.
198
-$PHPTHUMB_CONFIG['disable_imagecopyresampled']      = false;  // if true, ImageCopyResampled is replaced with ImageCopyResampleBicubic. May be needed for buggy versions of PHP-GD.
199
-$PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] = true;   // if true, any image that can be parsed by getimagesize() can be passed through; if false, only images that can be converted to GD by ImageCreateFrom(JPEG|GIF|PNG) functions are allowed
197
+$PHPTHUMB_CONFIG['disable_pathinfo_parsing']        = false; // if true, $_SERVER[PATH_INFO] is not parsed. May be needed on some server configurations to allow normal behavior.
198
+$PHPTHUMB_CONFIG['disable_imagecopyresampled']      = false; // if true, ImageCopyResampled is replaced with ImageCopyResampleBicubic. May be needed for buggy versions of PHP-GD.
199
+$PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] = true; // if true, any image that can be parsed by getimagesize() can be passed through; if false, only images that can be converted to GD by ImageCreateFrom(JPEG|GIF|PNG) functions are allowed
200 200
 
201 201
 // * HTTP remote file opening settings
202
-$PHPTHUMB_CONFIG['http_fopen_timeout']   = 10;   // timeout (in seconds) for fopen / curl / fsockopen
202
+$PHPTHUMB_CONFIG['http_fopen_timeout']   = 10; // timeout (in seconds) for fopen / curl / fsockopen
203 203
 $PHPTHUMB_CONFIG['http_follow_redirect'] = true; // if true (default), follow "302 Found" redirects to new URL; if false, return error message
204 204
 
205 205
 // * Speed optimizations configuration
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 // START DEFAULT PARAMETERS SECTION
214 214
 // If any parameters are constant across ALL images, you can set them here
215 215
 
216
-$PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE = true;  // if true, any parameters in the URL will override the defaults set here; if false, any parameters set here cannot be overridden in the URL
216
+$PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE = true; // if true, any parameters in the URL will override the defaults set here; if false, any parameters set here cannot be overridden in the URL
217 217
 $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS  = false; // if true, GETstring parameters will be ignored (except for 'src') and only below default parameters will be used; if false, both default and GETstring parameters will be used (depending on $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE). Will be auto-set true if !empty($PHPTHUMB_CONFIG['cache_default_only_suffix'])
218 218
 
219 219
 //$PHPTHUMB_DEFAULTS['w']    = 200;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 {
237 237
     global $PHPTHUMB_CONFIG;
238 238
 
239
-    return str_replace(@$PHPTHUMB_CONFIG['document_root'], '', __DIR__) . DIRECTORY_SEPARATOR . 'phpThumb.php?' . $ParameterString . '&hash=' . md5($ParameterString . @$PHPTHUMB_CONFIG['high_security_password']);
239
+    return str_replace(@$PHPTHUMB_CONFIG['document_root'], '', __DIR__).DIRECTORY_SEPARATOR.'phpThumb.php?'.$ParameterString.'&hash='.md5($ParameterString.@$PHPTHUMB_CONFIG['high_security_password']);
240 240
 }
241 241
 
242 242
 ///////////////////////////////////////////////////////////////////////////////
Please login to merge, or discard this patch.
phpthumb/phpthumb.unsharp.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,12 +92,12 @@
 block discarded – undo
92 92
             // Move copies of the image around one pixel at the time and merge them with weight
93 93
             // according to the matrix. The same matrix is simply repeated for higher radii.
94 94
             for ($i = 0; $i < $radius; $i++) {
95
-                imagecopy($imgBlur, $img, 0, 0, 1, 0, $w - 1, $h);               // left
96
-                imagecopymerge($imgBlur, $img, 1, 0, 0, 0, $w, $h, 50);       // right
97
-                imagecopymerge($imgBlur, $img, 0, 0, 0, 0, $w, $h, 50);       // center
95
+                imagecopy($imgBlur, $img, 0, 0, 1, 0, $w - 1, $h); // left
96
+                imagecopymerge($imgBlur, $img, 1, 0, 0, 0, $w, $h, 50); // right
97
+                imagecopymerge($imgBlur, $img, 0, 0, 0, 0, $w, $h, 50); // center
98 98
                 imagecopy($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h);
99 99
                 imagecopymerge($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 33.33333); // up
100
-                imagecopymerge($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 25);       // down
100
+                imagecopymerge($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 25); // down
101 101
             }
102 102
         }
103 103
 
Please login to merge, or discard this patch.
phpthumb/phpthumb.filters.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function ApplyMask(&$gdimg_mask, &$gdimg_image)
45 45
     {
46 46
         if (phpthumb_functions::gd_version() < 2) {
47
-            $this->DebugMessage('Skipping ApplyMask() because gd_version is "' . phpthumb_functions::gd_version() . '"', __FILE__, __LINE__);
47
+            $this->DebugMessage('Skipping ApplyMask() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
48 48
 
49 49
             return false;
50 50
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             }
81 81
         } else {
82 82
             // alpha merging requires PHP v4.3.2+
83
-            $this->DebugMessage('Skipping ApplyMask() technique because PHP is v"' . PHP_VERSION . '"', __FILE__, __LINE__);
83
+            $this->DebugMessage('Skipping ApplyMask() technique because PHP is v"'.PHP_VERSION.'"', __FILE__, __LINE__);
84 84
         }
85 85
 
86 86
         return true;
@@ -139,13 +139,13 @@  discard block
 block discarded – undo
139 139
             // Move copies of the image around one pixel at the time and merge them with weight
140 140
             // according to the matrix. The same matrix is simply repeated for higher radii.
141 141
             for ($i = 0; $i < $radius; $i++) {
142
-                imagecopy($imgBlur, $gdimg, 0, 0, 1, 1, $w - 1, $h - 1);            // up left
143
-                imagecopymerge($imgBlur, $gdimg, 1, 1, 0, 0, $w, $h, 50.00000);  // down right
144
-                imagecopymerge($imgBlur, $gdimg, 0, 1, 1, 0, $w - 1, $h, 33.33333);  // down left
145
-                imagecopymerge($imgBlur, $gdimg, 1, 0, 0, 1, $w, $h - 1, 25.00000);  // up right
146
-                imagecopymerge($imgBlur, $gdimg, 0, 0, 1, 0, $w - 1, $h, 33.33333);  // left
147
-                imagecopymerge($imgBlur, $gdimg, 1, 0, 0, 0, $w, $h, 25.00000);  // right
148
-                imagecopymerge($imgBlur, $gdimg, 0, 0, 0, 1, $w, $h - 1, 20.00000);  // up
142
+                imagecopy($imgBlur, $gdimg, 0, 0, 1, 1, $w - 1, $h - 1); // up left
143
+                imagecopymerge($imgBlur, $gdimg, 1, 1, 0, 0, $w, $h, 50.00000); // down right
144
+                imagecopymerge($imgBlur, $gdimg, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left
145
+                imagecopymerge($imgBlur, $gdimg, 1, 0, 0, 1, $w, $h - 1, 25.00000); // up right
146
+                imagecopymerge($imgBlur, $gdimg, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left
147
+                imagecopymerge($imgBlur, $gdimg, 1, 0, 0, 0, $w, $h, 25.00000); // right
148
+                imagecopymerge($imgBlur, $gdimg, 0, 0, 0, 1, $w, $h - 1, 20.00000); // up
149 149
                 imagecopymerge($imgBlur, $gdimg, 0, 1, 0, 0, $w, $h, 16.666667); // down
150 150
                 imagecopymerge($imgBlur, $gdimg, 0, 0, 0, 0, $w, $h, 50.000000); // center
151 151
                 imagecopy($gdimg, $imgBlur, 0, 0, 0, 0, $w, $h);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             if (imagefilter($gdimg, IMG_FILTER_BRIGHTNESS, $amount)) {
214 214
                 return true;
215 215
             }
216
-            $this->DebugMessage('FAILED: imagefilter($gdimg, IMG_FILTER_BRIGHTNESS, ' . $amount . ')', __FILE__, __LINE__);
216
+            $this->DebugMessage('FAILED: imagefilter($gdimg, IMG_FILTER_BRIGHTNESS, '.$amount.')', __FILE__, __LINE__);
217 217
             // fall through and try it the hard way
218 218
         }
219 219
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             if (imagefilter($gdimg, IMG_FILTER_CONTRAST, $amount)) {
254 254
                 return true;
255 255
             }
256
-            $this->DebugMessage('FAILED: imagefilter($gdimg, IMG_FILTER_CONTRAST, ' . $amount . ')', __FILE__, __LINE__);
256
+            $this->DebugMessage('FAILED: imagefilter($gdimg, IMG_FILTER_CONTRAST, '.$amount.')', __FILE__, __LINE__);
257 257
             // fall through and try it the hard way
258 258
         }
259 259
 
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
             'a' => 'alpha',
719 719
             '*' => (0 == $method) ? 'all' : 'gray'
720 720
         ];
721
-        $band     = substr($band, 0, 1);
721
+        $band = substr($band, 0, 1);
722 722
         if (!isset($keys[$band])) {
723 723
             return false;
724 724
         }
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 
941 941
             return true;
942 942
         } else {
943
-            $this->DebugMessage('FAILED: $gd_border_canvas = phpthumb_functions::ImageCreateFunction(' . $output_width . ', ' . $output_height . ')', __FILE__, __LINE__);
943
+            $this->DebugMessage('FAILED: $gd_border_canvas = phpthumb_functions::ImageCreateFunction('.$output_width.', '.$output_height.')', __FILE__, __LINE__);
944 944
         }
945 945
 
946 946
         return false;
@@ -1115,15 +1115,15 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
                 self::ApplyMask($gdimg_cornermask, $gdimg);
1117 1117
                 imagedestroy($gdimg_cornermask);
1118
-                $this->DebugMessage('RoundedImageCorners(' . $radius_x . ', ' . $radius_y . ') succeeded', __FILE__, __LINE__);
1118
+                $this->DebugMessage('RoundedImageCorners('.$radius_x.', '.$radius_y.') succeeded', __FILE__, __LINE__);
1119 1119
 
1120 1120
                 return true;
1121 1121
             } else {
1122
-                $this->DebugMessage('FAILED: $gdimg_cornermask = phpthumb_functions::ImageCreateFunction(' . imagesx($gdimg) . ', ' . imagesy($gdimg) . ')', __FILE__, __LINE__);
1122
+                $this->DebugMessage('FAILED: $gdimg_cornermask = phpthumb_functions::ImageCreateFunction('.imagesx($gdimg).', '.imagesy($gdimg).')', __FILE__, __LINE__);
1123 1123
             }
1124 1124
             imagedestroy($gdimg_cornermask_triple);
1125 1125
         } else {
1126
-            $this->DebugMessage('FAILED: $gdimg_cornermask_triple = phpthumb_functions::ImageCreateFunction(' . ($radius_x * 6) . ', ' . ($radius_y * 6) . ')', __FILE__, __LINE__);
1126
+            $this->DebugMessage('FAILED: $gdimg_cornermask_triple = phpthumb_functions::ImageCreateFunction('.($radius_x * 6).', '.($radius_y * 6).')', __FILE__, __LINE__);
1127 1127
         }
1128 1128
 
1129 1129
         return false;
@@ -1225,11 +1225,11 @@  discard block
 block discarded – undo
1225 1225
             if (imagefilter($gdimg, IMG_FILTER_SMOOTH, $amount)) {
1226 1226
                 return true;
1227 1227
             }
1228
-            $this->DebugMessage('FAILED: imagefilter($gdimg, IMG_FILTER_SMOOTH, ' . $amount . ')', __FILE__, __LINE__);
1228
+            $this->DebugMessage('FAILED: imagefilter($gdimg, IMG_FILTER_SMOOTH, '.$amount.')', __FILE__, __LINE__);
1229 1229
             // fall through and try it the hard way
1230 1230
         }
1231 1231
         // currently not implemented "the hard way"
1232
-        $this->DebugMessage('FAILED: phpthumb_filters::Smooth($gdimg, ' . $amount . ') [function not implemented]', __FILE__, __LINE__);
1232
+        $this->DebugMessage('FAILED: phpthumb_filters::Smooth($gdimg, '.$amount.') [function not implemented]', __FILE__, __LINE__);
1233 1233
 
1234 1234
         return false;
1235 1235
     }
@@ -1423,18 +1423,18 @@  discard block
 block discarded – undo
1423 1423
             '^y'  => imagesy($gdimg),
1424 1424
             '^^'  => '^',
1425 1425
         ];
1426
-        $text          = strtr($text, $metaTextArray);
1426
+        $text = strtr($text, $metaTextArray);
1427 1427
 
1428 1428
         $text      = str_replace("\r\n", "\n", $text);
1429 1429
         $text      = str_replace("\r", "\n", $text);
1430 1430
         $textlines = explode("\n", $text);
1431
-        $this->DebugMessage('Processing ' . count($textlines) . ' lines of text', __FILE__, __LINE__);
1431
+        $this->DebugMessage('Processing '.count($textlines).' lines of text', __FILE__, __LINE__);
1432 1432
 
1433 1433
         if (@is_readable($ttffont) && is_file($ttffont)) {
1434 1434
             $opacity           = 100 - (int)max(min($opacity, 100), 0);
1435 1435
             $letter_color_text = phpthumb_functions::ImageHexColorAllocate($gdimg, $hex_color, false, $opacity * 1.27);
1436 1436
 
1437
-            $this->DebugMessage('Using TTF font "' . $ttffont . '"', __FILE__, __LINE__);
1437
+            $this->DebugMessage('Using TTF font "'.$ttffont.'"', __FILE__, __LINE__);
1438 1438
 
1439 1439
             $TTFbox = imagettfbbox($size, $angle, $ttffont, $text);
1440 1440
 
@@ -1535,7 +1535,7 @@  discard block
 block discarded – undo
1535 1535
                 $y_TL = preg_match('#y#i', $fillextend) ? 0 : min($y1, $y2);
1536 1536
                 $x_BR = preg_match('#x#i', $fillextend) ? imagesx($gdimg) : max($x1, $x2);
1537 1537
                 $y_BR = preg_match('#y#i', $fillextend) ? imagesy($gdimg) : max($y1, $y2);
1538
-                $this->DebugMessage('WatermarkText() calling imagefilledrectangle($gdimg, ' . $x_TL . ', ' . $y_TL . ', ' . $x_BR . ', ' . $y_BR . ', $text_color_background)', __FILE__, __LINE__);
1538
+                $this->DebugMessage('WatermarkText() calling imagefilledrectangle($gdimg, '.$x_TL.', '.$y_TL.', '.$x_BR.', '.$y_BR.', $text_color_background)', __FILE__, __LINE__);
1539 1539
                 imagefilledrectangle($gdimg, $x_TL, $y_TL, $x_BR, $y_BR, $text_color_background);
1540 1540
 
1541 1541
                 // end block for background color only
@@ -1570,7 +1570,7 @@  discard block
 block discarded – undo
1570 1570
                     }
1571 1571
 
1572 1572
                     //imagettftext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, $text);
1573
-                    $this->DebugMessage('WatermarkText() calling imagettftext($gdimg, ' . $size . ', ' . $angle . ', ' . $text_origin_x . ', ' . ($text_origin_y + $y_offset) . ', $letter_color_text, ' . $ttffont . ', ' . $line . ')', __FILE__, __LINE__);
1573
+                    $this->DebugMessage('WatermarkText() calling imagettftext($gdimg, '.$size.', '.$angle.', '.$text_origin_x.', '.($text_origin_y + $y_offset).', $letter_color_text, '.$ttffont.', '.$line.')', __FILE__, __LINE__);
1574 1574
                     imagettftext($gdimg, $size, $angle, $text_origin_x, $text_origin_y + $y_offset, $letter_color_text, $ttffont, $line);
1575 1575
 
1576 1576
                     $y_offset += $char_height;
@@ -1580,12 +1580,12 @@  discard block
 block discarded – undo
1580 1580
             return true;
1581 1581
         } else {
1582 1582
             $size = min(5, max(1, $size));
1583
-            $this->DebugMessage('Using built-in font (size=' . $size . ') for text watermark' . ($ttffont ? ' because $ttffont !is_readable(' . $ttffont . ')' : ''), __FILE__, __LINE__);
1583
+            $this->DebugMessage('Using built-in font (size='.$size.') for text watermark'.($ttffont ? ' because $ttffont !is_readable('.$ttffont.')' : ''), __FILE__, __LINE__);
1584 1584
 
1585 1585
             $text_width  = 0;
1586 1586
             $text_height = 0;
1587 1587
             foreach ($textlines as $dummy => $line) {
1588
-                $text_width  = max($text_width, imagefontwidth($size) * strlen($line));
1588
+                $text_width = max($text_width, imagefontwidth($size) * strlen($line));
1589 1589
                 $text_height += imagefontheight($size);
1590 1590
             }
1591 1591
             if ($img_watermark = phpthumb_functions::ImageCreateFunction($text_width, $text_height)) {
@@ -1596,7 +1596,7 @@  discard block
 block discarded – undo
1596 1596
                 } else {
1597 1597
                     $text_color_background = phpthumb_functions::ImageHexColorAllocate($img_watermark, 'FFFFFF', false, 127);
1598 1598
                 }
1599
-                $this->DebugMessage('WatermarkText() calling imagefilledrectangle($img_watermark, 0, 0, ' . imagesx($img_watermark) . ', ' . imagesy($img_watermark) . ', $text_color_background)', __FILE__, __LINE__);
1599
+                $this->DebugMessage('WatermarkText() calling imagefilledrectangle($img_watermark, 0, 0, '.imagesx($img_watermark).', '.imagesy($img_watermark).', $text_color_background)', __FILE__, __LINE__);
1600 1600
                 imagefilledrectangle($img_watermark, 0, 0, imagesx($img_watermark), imagesy($img_watermark), $text_color_background);
1601 1601
 
1602 1602
                 $img_watermark_mask    = false;
@@ -1675,10 +1675,10 @@  discard block
 block discarded – undo
1675 1675
                             }
1676 1676
                             break;
1677 1677
                     }
1678
-                    $this->DebugMessage('WatermarkText() calling imagestring($img_watermark, ' . $size . ', ' . $x_offset . ', ' . ($key * imagefontheight($size)) . ', ' . $line . ', $text_color_watermark)', __FILE__, __LINE__);
1678
+                    $this->DebugMessage('WatermarkText() calling imagestring($img_watermark, '.$size.', '.$x_offset.', '.($key * imagefontheight($size)).', '.$line.', $text_color_watermark)', __FILE__, __LINE__);
1679 1679
                     imagestring($img_watermark, $size, $x_offset, $key * imagefontheight($size), $line, $text_color_watermark);
1680 1680
                     if ($angle && $img_watermark_mask) {
1681
-                        $this->DebugMessage('WatermarkText() calling imagestring($img_watermark_mask, ' . $size . ', ' . $x_offset . ', ' . ($key * imagefontheight($size)) . ', ' . $text . ', $mask_color_watermark)', __FILE__, __LINE__);
1681
+                        $this->DebugMessage('WatermarkText() calling imagestring($img_watermark_mask, '.$size.', '.$x_offset.', '.($key * imagefontheight($size)).', '.$text.', $mask_color_watermark)', __FILE__, __LINE__);
1682 1682
                         imagestring($img_watermark_mask, $size, $x_offset, $key * imagefontheight($size), $text, $mask_color_watermark);
1683 1683
                     }
1684 1684
                 }
@@ -1688,8 +1688,8 @@  discard block
 block discarded – undo
1688 1688
                     self::ApplyMask($img_watermark_mask, $img_watermark);
1689 1689
                 }
1690 1690
                 //phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, $alignment, $opacity, $margin);
1691
-                $this->DebugMessage('WatermarkText() calling phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, ' . ($originOffsetX . 'x' . $originOffsetY) . ', ' . $opacity . ', 0)', __FILE__, __LINE__);
1692
-                self::WatermarkOverlay($gdimg, $img_watermark, $originOffsetX . 'x' . $originOffsetY, $opacity, 0);
1691
+                $this->DebugMessage('WatermarkText() calling phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, '.($originOffsetX.'x'.$originOffsetY).', '.$opacity.', 0)', __FILE__, __LINE__);
1692
+                self::WatermarkOverlay($gdimg, $img_watermark, $originOffsetX.'x'.$originOffsetY, $opacity, 0);
1693 1693
                 imagedestroy($img_watermark);
1694 1694
 
1695 1695
                 return true;
Please login to merge, or discard this patch.