-
diff --git composer.json composer.json
index 7be27081..f105c2ae 100644
|
|
|
|
| 3 | 3 | "license": "GPL-2.0-or-later", |
| 4 | 4 | "description": "bbPress is forum software with a twist from the creators of WordPress.", |
| 5 | 5 | "require-dev": { |
| | 6 | "squizlabs/php_codesniffer": "^3.7.2", |
| 6 | 7 | "phpcompatibility/phpcompatibility-wp": "^2.1", |
| 7 | | "wp-coding-standards/wpcs": "^2.3", |
| 8 | | "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", |
| | 8 | "wp-coding-standards/wpcs": "^3.0", |
| | 9 | "dealerdirect/phpcodesniffer-composer-installer": "^1.0", |
| 9 | 10 | "phpunit/phpunit": "^9", |
| 10 | 11 | "yoast/phpunit-polyfills": "^3.0" |
| 11 | 12 | }, |
-
diff --git phpcs.xml.dist phpcs.xml.dist
index 7ecf9303..183f7ad2 100644
|
|
|
|
| 105 | 105 | </properties> |
| 106 | 106 | </rule> |
| 107 | 107 | |
| 108 | | <rule ref="WordPress.PHP.NoSilencedErrors"> |
| 109 | | <properties> |
| 110 | | <property name="use_default_whitelist" value="true"/> |
| 111 | | </properties> |
| 112 | | </rule> |
| 113 | | |
| 114 | 108 | |
| 115 | 109 | <!-- |
| 116 | 110 | ############################################################################# |
| … |
… |
|
| 156 | 150 | <exclude-pattern>/src/*</exclude-pattern> |
| 157 | 151 | </rule> |
| 158 | 152 | |
| 159 | | <rule ref="WordPress.Arrays.CommaAfterArrayItem.NoComma"> |
| 160 | | <exclude-pattern>/src/*</exclude-pattern> |
| 161 | | </rule> |
| 162 | | |
| 163 | 153 | |
| 164 | 154 | <!-- |
| 165 | 155 | ############################################################################# |
| … |
… |
|
| 167 | 157 | Adjustments which should be removed once the associated issues have been reviewed and resolved. |
| 168 | 158 | ############################################################################# |
| 169 | 159 | --> |
| | 160 | |
| | 161 | <rule ref="Generic.CodeAnalysis.AssignmentInCondition.Found"> |
| | 162 | <exclude-pattern>/src/*</exclude-pattern> |
| | 163 | </rule> |
| 170 | 164 | |
| 171 | | <!-- Rules that require further review, partially reviewed --> |
| | 165 | <rule ref="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"> |
| | 166 | <exclude-pattern>/src/*</exclude-pattern> |
| | 167 | </rule> |
| 172 | 168 | |
| 173 | | <rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine"> |
| | 169 | <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"> |
| 174 | 170 | <exclude-pattern>/src/*</exclude-pattern> |
| 175 | 171 | </rule> |
| 176 | 172 | |
| 177 | | <rule ref="Generic.Formatting.SpaceAfterCast.TooMuchSpace"> |
| | 173 | <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIf"> |
| 178 | 174 | <exclude-pattern>/src/*</exclude-pattern> |
| 179 | 175 | </rule> |
| 180 | 176 | |
| 181 | | <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace"> |
| | 177 | <rule ref="Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence.MissingParentheses"> |
| 182 | 178 | <exclude-pattern>/src/*</exclude-pattern> |
| 183 | 179 | </rule> |
| 184 | 180 | |
| 185 | | <rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose"> |
| | 181 | <rule ref="Generic.CodeAnalysis.UselessOverridingMethod.Found"> |
| 186 | 182 | <exclude-pattern>/src/*</exclude-pattern> |
| 187 | 183 | </rule> |
| 188 | 184 | |
| 189 | | <rule ref="PEAR.Functions.FunctionCallSignature.Indent"> |
| | 185 | <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed"> |
| 190 | 186 | <exclude-pattern>/src/*</exclude-pattern> |
| 191 | 187 | </rule> |
| 192 | 188 | |
| 193 | | <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine"> |
| | 189 | <rule ref="Generic.Files.LineEndings.InvalidEOLChar"> |
| 194 | 190 | <exclude-pattern>/src/*</exclude-pattern> |
| 195 | 191 | </rule> |
| 196 | 192 | |
| 197 | | <rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"> |
| | 193 | <rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound"> |
| 198 | 194 | <exclude-pattern>/src/*</exclude-pattern> |
| 199 | 195 | </rule> |
| 200 | 196 | |
| 201 | | <!-- Rules that require further review, not yet reviewed --> |
| | 197 | <rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine"> |
| | 198 | <exclude-pattern>/src/*</exclude-pattern> |
| | 199 | </rule> |
| 202 | 200 | |
| 203 | | <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"> |
| | 201 | <rule ref="Generic.Formatting.SpaceAfterCast.TooMuchSpace"> |
| 204 | 202 | <exclude-pattern>/src/*</exclude-pattern> |
| 205 | 203 | </rule> |
| 206 | 204 | |
| 207 | | <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIf"> |
| | 205 | <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace"> |
| 208 | 206 | <exclude-pattern>/src/*</exclude-pattern> |
| 209 | 207 | </rule> |
| 210 | 208 | |
| 211 | | <rule ref="Generic.CodeAnalysis.UselessOverridingMethod.Found"> |
| | 209 | <rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose"> |
| 212 | 210 | <exclude-pattern>/src/*</exclude-pattern> |
| 213 | 211 | </rule> |
| 214 | 212 | |
| 215 | | <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed"> |
| | 213 | <rule ref="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"> |
| 216 | 214 | <exclude-pattern>/src/*</exclude-pattern> |
| 217 | 215 | </rule> |
| 218 | 216 | |
| 219 | | <rule ref="Generic.Files.LineEndings.InvalidEOLChar"> |
| | 217 | <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerMultiLine"> |
| 220 | 218 | <exclude-pattern>/src/*</exclude-pattern> |
| 221 | 219 | </rule> |
| 222 | 220 | |
| 223 | | <rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound"> |
| | 221 | <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine"> |
| | 222 | <exclude-pattern>/src/*</exclude-pattern> |
| | 223 | </rule> |
| | 224 | |
| | 225 | <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserMultiLine"> |
| | 226 | <exclude-pattern>/src/*</exclude-pattern> |
| | 227 | </rule> |
| | 228 | |
| | 229 | <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserSingleLine"> |
| | 230 | <exclude-pattern>/src/*</exclude-pattern> |
| | 231 | </rule> |
| | 232 | |
| | 233 | <rule ref="NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine"> |
| | 234 | <exclude-pattern>/src/*</exclude-pattern> |
| | 235 | </rule> |
| | 236 | |
| | 237 | <rule ref="NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLineCloserSameLine"> |
| 224 | 238 | <exclude-pattern>/src/*</exclude-pattern> |
| 225 | 239 | </rule> |
| 226 | 240 | |
| … |
… |
|
| 237 | 251 | <exclude-pattern>/src/*</exclude-pattern> |
| 238 | 252 | </rule> |
| 239 | 253 | |
| | 254 | <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine"> |
| | 255 | <exclude-pattern>/src/*</exclude-pattern> |
| | 256 | </rule> |
| | 257 | |
| 240 | 258 | <rule ref="PEAR.Functions.FunctionCallSignature.FirstArgumentPosition"> |
| 241 | 259 | <exclude-pattern>/src/*</exclude-pattern> |
| 242 | 260 | </rule> |
| 243 | 261 | |
| | 262 | <rule ref="PEAR.Functions.FunctionCallSignature.Indent"> |
| | 263 | <exclude-pattern>/src/*</exclude-pattern> |
| | 264 | </rule> |
| | 265 | |
| 244 | 266 | <rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments"> |
| 245 | 267 | <exclude-pattern>/src/*</exclude-pattern> |
| 246 | 268 | </rule> |
| … |
… |
|
| 269 | 291 | <exclude-pattern>/src/*</exclude-pattern> |
| 270 | 292 | </rule> |
| 271 | 293 | |
| | 294 | <rule ref="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"> |
| | 295 | <exclude-pattern>/src/*</exclude-pattern> |
| | 296 | </rule> |
| | 297 | |
| 272 | 298 | <rule ref="PSR2.Classes.PropertyDeclaration.ScopeMissing"> |
| 273 | 299 | <exclude-pattern>/src/*</exclude-pattern> |
| 274 | 300 | </rule> |
| … |
… |
|
| 293 | 319 | <exclude-pattern>/src/*</exclude-pattern> |
| 294 | 320 | </rule> |
| 295 | 321 | |
| | 322 | <rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"> |
| | 323 | <exclude-pattern>/src/*</exclude-pattern> |
| | 324 | </rule> |
| | 325 | |
| 296 | 326 | <rule ref="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE"> |
| 297 | 327 | <exclude-pattern>/src/*</exclude-pattern> |
| 298 | 328 | </rule> |
| … |
… |
|
| 301 | 331 | <exclude-pattern>/src/*</exclude-pattern> |
| 302 | 332 | </rule> |
| 303 | 333 | |
| | 334 | <rule ref="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose"> |
| | 335 | <exclude-pattern>/src/*</exclude-pattern> |
| | 336 | </rule> |
| | 337 | |
| 304 | 338 | <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> |
| 305 | 339 | <exclude-pattern>/src/*</exclude-pattern> |
| 306 | 340 | </rule> |
| … |
… |
|
| 317 | 351 | <exclude-pattern>/src/*</exclude-pattern> |
| 318 | 352 | </rule> |
| 319 | 353 | |
| | 354 | <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose"> |
| | 355 | <exclude-pattern>/src/*</exclude-pattern> |
| | 356 | </rule> |
| | 357 | |
| | 358 | <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace"> |
| | 359 | <exclude-pattern>/src/*</exclude-pattern> |
| | 360 | </rule> |
| | 361 | |
| 320 | 362 | <rule ref="Squiz.PHP.CommentedOutCode.Found"> |
| 321 | 363 | <exclude-pattern>/src/*</exclude-pattern> |
| 322 | 364 | </rule> |
| … |
… |
|
| 361 | 403 | <exclude-pattern>/src/*</exclude-pattern> |
| 362 | 404 | </rule> |
| 363 | 405 | |
| 364 | | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine"> |
| | 406 | <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"> |
| 365 | 407 | <exclude-pattern>/src/*</exclude-pattern> |
| 366 | 408 | </rule> |
| 367 | 409 | |
| 368 | | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"> |
| | 410 | <rule ref="Universal.Arrays.DuplicateArrayKey.Found"> |
| 369 | 411 | <exclude-pattern>/src/*</exclude-pattern> |
| 370 | 412 | </rule> |
| 371 | 413 | |
| 372 | | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.CloseBraceNewLine"> |
| | 414 | <rule ref="Universal.ControlStructures.DisallowLonelyIf.Found"> |
| 373 | 415 | <exclude-pattern>/src/*</exclude-pattern> |
| 374 | 416 | </rule> |
| 375 | 417 | |
| 376 | | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener"> |
| | 418 | <rule ref="Universal.Files.SeparateFunctionsFromOO.Mixed"> |
| 377 | 419 | <exclude-pattern>/src/*</exclude-pattern> |
| 378 | 420 | </rule> |
| 379 | 421 | |
| 380 | | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser"> |
| | 422 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound"> |
| 381 | 423 | <exclude-pattern>/src/*</exclude-pattern> |
| 382 | 424 | </rule> |
| 383 | 425 | |
| 384 | | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.SpaceBeforeArrayCloser"> |
| | 426 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.classFound"> |
| 385 | 427 | <exclude-pattern>/src/*</exclude-pattern> |
| 386 | 428 | </rule> |
| 387 | 429 | |
| 388 | | <rule ref="WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned"> |
| | 430 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound"> |
| 389 | 431 | <exclude-pattern>/src/*</exclude-pattern> |
| 390 | 432 | </rule> |
| 391 | 433 | |
| 392 | | <rule ref="WordPress.Arrays.ArrayIndentation.ItemNotAligned"> |
| | 434 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound"> |
| 393 | 435 | <exclude-pattern>/src/*</exclude-pattern> |
| 394 | 436 | </rule> |
| 395 | 437 | |
| 396 | | <rule ref="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned"> |
| | 438 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.objectFound"> |
| 397 | 439 | <exclude-pattern>/src/*</exclude-pattern> |
| 398 | 440 | </rule> |
| 399 | 441 | |
| 400 | | <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys"> |
| | 442 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.parentFound"> |
| 401 | 443 | <exclude-pattern>/src/*</exclude-pattern> |
| 402 | 444 | </rule> |
| 403 | 445 | |
| 404 | | <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys"> |
| | 446 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.require_onceFound"> |
| 405 | 447 | <exclude-pattern>/src/*</exclude-pattern> |
| 406 | 448 | </rule> |
| 407 | 449 | |
| 408 | | <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.TooMuchSpaceAfterKey"> |
| | 450 | <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.stringFound"> |
| 409 | 451 | <exclude-pattern>/src/*</exclude-pattern> |
| 410 | 452 | </rule> |
| 411 | 453 | |
| 412 | | <rule ref="WordPress.Arrays.CommaAfterArrayItem.SpaceAfterComma"> |
| | 454 | <rule ref="Universal.Operators.DisallowStandalonePostIncrementDecrement.PostDecrementFound"> |
| 413 | 455 | <exclude-pattern>/src/*</exclude-pattern> |
| 414 | 456 | </rule> |
| 415 | 457 | |
| 416 | | <rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"> |
| | 458 | <rule ref="Universal.Operators.DisallowStandalonePostIncrementDecrement.PostIncrementFound"> |
| 417 | 459 | <exclude-pattern>/src/*</exclude-pattern> |
| 418 | 460 | </rule> |
| 419 | 461 | |
| 420 | | <rule ref="WordPress.Arrays.MultipleStatementAlignment.MultilineItemSpaceBeforeDoubleArrow"> |
| | 462 | <rule ref="Universal.Operators.StrictComparisons.LooseEqual"> |
| 421 | 463 | <exclude-pattern>/src/*</exclude-pattern> |
| 422 | 464 | </rule> |
| 423 | 465 | |
| 424 | | <rule ref="WordPress.Arrays.MultipleStatementAlignment.SpaceBeforeDoubleArrow"> |
| | 466 | <rule ref="Universal.Operators.StrictComparisons.LooseNotEqual"> |
| 425 | 467 | <exclude-pattern>/src/*</exclude-pattern> |
| 426 | 468 | </rule> |
| 427 | 469 | |
| 428 | | <rule ref="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"> |
| | 470 | <rule ref="Universal.WhiteSpace.CommaSpacing.TooMuchSpaceAfter"> |
| 429 | 471 | <exclude-pattern>/src/*</exclude-pattern> |
| 430 | 472 | </rule> |
| 431 | 473 | |
| 432 | | <rule ref="WordPress.CodeAnalysis.AssignmentInCondition.Found"> |
| | 474 | <rule ref="Universal.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed"> |
| 433 | 475 | <exclude-pattern>/src/*</exclude-pattern> |
| 434 | 476 | </rule> |
| 435 | 477 | |
| 436 | | <rule ref="WordPress.CodeAnalysis.EmptyStatement"> |
| | 478 | <rule ref="Universal.WhiteSpace.PrecisionAlignment.Found"> |
| 437 | 479 | <exclude-pattern>/src/*</exclude-pattern> |
| 438 | 480 | </rule> |
| 439 | 481 | |
| 440 | | <rule ref="WordPress.DateTime.CurrentTimeTimestamp.Requested"> |
| | 482 | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine"> |
| 441 | 483 | <exclude-pattern>/src/*</exclude-pattern> |
| 442 | 484 | </rule> |
| 443 | 485 | |
| 444 | | <rule ref="WordPress.DateTime.RestrictedFunctions.date_date"> |
| | 486 | <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"> |
| 445 | 487 | <exclude-pattern>/src/*</exclude-pattern> |
| 446 | 488 | </rule> |
| 447 | 489 | |
| 448 | | <rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared"> |
| | 490 | <rule ref="WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned"> |
| | 491 | <exclude-pattern>/src/*</exclude-pattern> |
| | 492 | </rule> |
| | 493 | |
| | 494 | <rule ref="WordPress.Arrays.ArrayIndentation.ItemNotAligned"> |
| | 495 | <exclude-pattern>/src/*</exclude-pattern> |
| | 496 | </rule> |
| | 497 | |
| | 498 | <rule ref="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned"> |
| | 499 | <exclude-pattern>/src/*</exclude-pattern> |
| | 500 | </rule> |
| | 501 | |
| | 502 | <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys"> |
| | 503 | <exclude-pattern>/src/*</exclude-pattern> |
| | 504 | </rule> |
| | 505 | |
| | 506 | <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys"> |
| | 507 | <exclude-pattern>/src/*</exclude-pattern> |
| | 508 | </rule> |
| | 509 | |
| | 510 | <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.TooMuchSpaceAfterKey"> |
| | 511 | <exclude-pattern>/src/*</exclude-pattern> |
| | 512 | </rule> |
| | 513 | |
| | 514 | <rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"> |
| | 515 | <exclude-pattern>/src/*</exclude-pattern> |
| | 516 | </rule> |
| | 517 | |
| | 518 | <rule ref="WordPress.Arrays.MultipleStatementAlignment.MultilineItemSpaceBeforeDoubleArrow"> |
| 449 | 519 | <exclude-pattern>/src/*</exclude-pattern> |
| 450 | 520 | </rule> |
| 451 | 521 | |
| | 522 | <rule ref="WordPress.Arrays.MultipleStatementAlignment.SpaceBeforeDoubleArrow"> |
| | 523 | <exclude-pattern>/src/*</exclude-pattern> |
| | 524 | </rule> |
| | 525 | |
| | 526 | <rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared"> |
| | 527 | <exclude-pattern>/src/*</exclude-pattern> |
| | 528 | </rule> |
| | 529 | |
| 452 | 530 | <rule ref="WordPress.DB.PreparedSQL.NotPrepared"> |
| 453 | 531 | <exclude-pattern>/src/*</exclude-pattern> |
| 454 | 532 | </rule> |
| 455 | 533 | |
| 456 | | <rule ref="WordPress.Files.FileName.InvalidClassFileName"> |
| | 534 | <rule ref="WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare"> |
| | 535 | <exclude-pattern>/src/*</exclude-pattern> |
| | 536 | </rule> |
| | 537 | |
| | 538 | <rule ref="WordPress.DateTime.CurrentTimeTimestamp.Requested"> |
| 457 | 539 | <exclude-pattern>/src/*</exclude-pattern> |
| 458 | 540 | </rule> |
| 459 | 541 | |
| | 542 | <rule ref="WordPress.DateTime.RestrictedFunctions.date_date"> |
| | 543 | <exclude-pattern>/src/*</exclude-pattern> |
| | 544 | </rule> |
| | 545 | |
| | 546 | <rule ref="WordPress.Files.FileName.InvalidClassFileName"> |
| | 547 | <exclude-pattern>/src/*</exclude-pattern> |
| | 548 | </rule> |
| | 549 | |
| 460 | 550 | <rule ref="WordPress.Files.FileName.NotHyphenatedLowercase"> |
| 461 | 551 | <exclude-pattern>/src/*</exclude-pattern> |
| 462 | 552 | </rule> |
| … |
… |
|
| 470 | 560 | </rule> |
| 471 | 561 | |
| 472 | 562 | <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound"> |
| 473 | | <exclude-pattern>/src/*</exclude-pattern> |
| | 563 | <exclude-pattern>/src/*</exclude-pattern> |
| 474 | 564 | </rule> |
| 475 | 565 | |
| 476 | 566 | <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound"> |
| … |
… |
|
| 485 | 575 | <exclude-pattern>/src/*</exclude-pattern> |
| 486 | 576 | </rule> |
| 487 | 577 | |
| 488 | | <rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"> |
| 489 | | <exclude-pattern>/src/*</exclude-pattern> |
| 490 | | </rule> |
| 491 | | |
| 492 | 578 | <rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"> |
| 493 | 579 | <exclude-pattern>/src/*</exclude-pattern> |
| 494 | 580 | </rule> |
| … |
… |
|
| 517 | 603 | <exclude-pattern>/src/*</exclude-pattern> |
| 518 | 604 | </rule> |
| 519 | 605 | |
| 520 | | <rule ref="WordPress.PHP.StrictComparisons.LooseComparison"> |
| | 606 | <rule ref="WordPress.PHP.StrictInArray.MissingTrueStrict"> |
| 521 | 607 | <exclude-pattern>/src/*</exclude-pattern> |
| 522 | 608 | </rule> |
| 523 | 609 | |
| 524 | | <rule ref="WordPress.PHP.StrictInArray.MissingTrueStrict"> |
| | 610 | <rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped"> |
| 525 | 611 | <exclude-pattern>/src/*</exclude-pattern> |
| 526 | 612 | </rule> |
| 527 | 613 | |
| 528 | | <rule ref="WordPress.PHP.YodaConditions.NotYoda"> |
| | 614 | <rule ref="WordPress.Security.EscapeOutput.UnsafePrintingFunction"> |
| 529 | 615 | <exclude-pattern>/src/*</exclude-pattern> |
| 530 | 616 | </rule> |
| 531 | 617 | |
| 532 | | <rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped"> |
| | 618 | <rule ref="WordPress.Security.NonceVerification.Missing"> |
| 533 | 619 | <exclude-pattern>/src/*</exclude-pattern> |
| 534 | 620 | </rule> |
| 535 | 621 | |
| 536 | | <rule ref="WordPress.Security.EscapeOutput.UnsafePrintingFunction"> |
| | 622 | <rule ref="WordPress.Security.NonceVerification.Recommended"> |
| 537 | 623 | <exclude-pattern>/src/*</exclude-pattern> |
| 538 | 624 | </rule> |
| 539 | 625 | |
| 540 | | <rule ref="WordPress.Security.NonceVerification.Missing"> |
| | 626 | <rule ref="WordPress.WP.AlternativeFunctions.json_encode_json_encode"> |
| 541 | 627 | <exclude-pattern>/src/*</exclude-pattern> |
| 542 | 628 | </rule> |
| 543 | 629 | |
| 544 | | <rule ref="WordPress.Security.NonceVerification.Recommended"> |
| | 630 | <rule ref="WordPress.WP.AlternativeFunctions.parse_url_parse_url"> |
| 545 | 631 | <exclude-pattern>/src/*</exclude-pattern> |
| 546 | 632 | </rule> |
| 547 | 633 | |
| 548 | | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterCloseParenthesis"> |
| | 634 | <rule ref="WordPress.WP.AlternativeFunctions.rand_mt_rand"> |
| 549 | 635 | <exclude-pattern>/src/*</exclude-pattern> |
| 550 | 636 | </rule> |
| 551 | 637 | |
| 552 | | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterOpenParenthesis"> |
| | 638 | <rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tag"> |
| 553 | 639 | <exclude-pattern>/src/*</exclude-pattern> |
| 554 | 640 | </rule> |
| 555 | 641 | |
| 556 | | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis"> |
| | 642 | <rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tags"> |
| 557 | 643 | <exclude-pattern>/src/*</exclude-pattern> |
| 558 | 644 | </rule> |
| 559 | 645 | |
| 560 | | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis"> |
| | 646 | <rule ref="WordPress.WP.Capabilities.Unknown"> |
| 561 | 647 | <exclude-pattern>/src/*</exclude-pattern> |
| 562 | 648 | </rule> |
| 563 | 649 | |
| 564 | | <rule ref="WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed"> |
| | 650 | <rule ref="WordPress.WP.DeprecatedParameters.Get_termsParam2Found"> |
| 565 | 651 | <exclude-pattern>/src/*</exclude-pattern> |
| 566 | 652 | </rule> |
| 567 | 653 | |
| 568 | | <rule ref="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter"> |
| | 654 | <rule ref="WordPress.WP.DeprecatedParameters.Wp_count_termsParam2Found"> |
| 569 | 655 | <exclude-pattern>/src/*</exclude-pattern> |
| 570 | 656 | </rule> |
| 571 | 657 | |
| 572 | | <rule ref="WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore"> |
| | 658 | <rule ref="WordPress.WP.DiscouragedFunctions.query_posts_query_posts"> |
| 573 | 659 | <exclude-pattern>/src/*</exclude-pattern> |
| 574 | 660 | </rule> |
| 575 | 661 | |
| 576 | | <rule ref="WordPress.WhiteSpace.OperatorSpacing.SpacingAfter"> |
| | 662 | <rule ref="WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query"> |
| 577 | 663 | <exclude-pattern>/src/*</exclude-pattern> |
| 578 | 664 | </rule> |
| 579 | 665 | |
| 580 | | <rule ref="WordPress.WhiteSpace.OperatorSpacing.SpacingBefore"> |
| | 666 | <rule ref="WordPress.WP.EnqueuedResourceParameters.NotInFooter"> |
| 581 | 667 | <exclude-pattern>/src/*</exclude-pattern> |
| 582 | 668 | </rule> |
| 583 | 669 | |
| 584 | | <rule ref="WordPress.WhiteSpace.PrecisionAlignment.Found"> |
| | 670 | <rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited"> |
| 585 | 671 | <exclude-pattern>/src/*</exclude-pattern> |
| 586 | 672 | </rule> |
| 587 | 673 | |
| 588 | | <rule ref="WordPress.WP.AlternativeFunctions.json_encode_json_encode"> |
| | 674 | <rule ref="WordPress.WP.I18n.LowLevelTranslationFunction"> |
| 589 | 675 | <exclude-pattern>/src/*</exclude-pattern> |
| 590 | 676 | </rule> |
| 591 | 677 | |
| 592 | | <rule ref="WordPress.WP.AlternativeFunctions.parse_url_parse_url"> |
| | 678 | <rule ref="WordPress.WP.I18n.MissingTranslatorsComment"> |
| 593 | 679 | <exclude-pattern>/src/*</exclude-pattern> |
| 594 | 680 | </rule> |
| 595 | 681 | |
| 596 | | <rule ref="WordPress.WP.AlternativeFunctions.rand_mt_rand"> |
| | 682 | <rule ref="WordPress.WP.I18n.NonSingularStringLiteralText"> |
| 597 | 683 | <exclude-pattern>/src/*</exclude-pattern> |
| 598 | 684 | </rule> |
| 599 | 685 | |
| 600 | | <rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tags"> |
| | 686 | <rule ref="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page"> |
| 601 | 687 | <exclude-pattern>/src/*</exclude-pattern> |
| 602 | 688 | </rule> |
| 603 | 689 | |
| 604 | | <rule ref="WordPress.WP.DiscouragedFunctions.query_posts_query_posts"> |
| | 690 | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterOpenParenthesis"> |
| 605 | 691 | <exclude-pattern>/src/*</exclude-pattern> |
| 606 | 692 | </rule> |
| 607 | 693 | |
| 608 | | <rule ref="WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query"> |
| | 694 | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceBeforeCloseParenthesis"> |
| 609 | 695 | <exclude-pattern>/src/*</exclude-pattern> |
| 610 | 696 | </rule> |
| 611 | 697 | |
| 612 | | <rule ref="WordPress.WP.EnqueuedResourceParameters.NotInFooter"> |
| | 698 | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis"> |
| 613 | 699 | <exclude-pattern>/src/*</exclude-pattern> |
| 614 | 700 | </rule> |
| 615 | 701 | |
| 616 | | <rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited"> |
| | 702 | <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis"> |
| 617 | 703 | <exclude-pattern>/src/*</exclude-pattern> |
| 618 | 704 | </rule> |
| 619 | 705 | |
| 620 | | <rule ref="WordPress.WP.I18n.LowLevelTranslationFunction"> |
| | 706 | <rule ref="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter"> |
| 621 | 707 | <exclude-pattern>/src/*</exclude-pattern> |
| 622 | 708 | </rule> |
| 623 | 709 | |
| 624 | | <rule ref="WordPress.WP.I18n.MissingTranslatorsComment"> |
| | 710 | <rule ref="WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore"> |
| 625 | 711 | <exclude-pattern>/src/*</exclude-pattern> |
| 626 | 712 | </rule> |
| 627 | 713 | |
| 628 | | <rule ref="WordPress.WP.I18n.NonSingularStringLiteralText"> |
| | 714 | <rule ref="WordPress.WhiteSpace.OperatorSpacing.SpacingAfter"> |
| 629 | 715 | <exclude-pattern>/src/*</exclude-pattern> |
| 630 | 716 | </rule> |
| 631 | 717 | |
| | 718 | <rule ref="WordPress.WhiteSpace.OperatorSpacing.SpacingBefore"> |
| | 719 | <exclude-pattern>/src/*</exclude-pattern> |
| | 720 | </rule> |
| | 721 | |
| 632 | 722 | </ruleset> |
-
diff --git src/includes/admin/classes/class-bbp-admin.php src/includes/admin/classes/class-bbp-admin.php
index 7b3b00b3..4316c10f 100644
|
|
|
class BBP_Admin { |
| 972 | 972 | /** Paths *************************************************************/ |
| 973 | 973 | |
| 974 | 974 | // Forum Archive |
| 975 | | } elseif ( $post->post_name === bbp_get_root_slug() ) { |
| | 975 | } elseif ( bbp_get_root_slug() === $post->post_name ) { |
| 976 | 976 | $retval[] = esc_html_x( 'Forum Archive', 'page label', 'bbpress' ); |
| 977 | 977 | |
| 978 | 978 | // Topic Archive |
| 979 | | } elseif ( $post->post_name === bbp_get_topic_archive_slug() ) { |
| | 979 | } elseif ( bbp_get_topic_archive_slug() === $post->post_name ) { |
| 980 | 980 | $retval[] = esc_html_x( 'Topic Archive', 'page label', 'bbpress' ); |
| 981 | 981 | } |
| 982 | 982 | |
-
diff --git src/includes/admin/classes/class-bbp-converter-base.php src/includes/admin/classes/class-bbp-converter-base.php
index 989fcd34..ee93a622 100644
|
|
|
abstract class BBP_Converter_Base { |
| 472 | 472 | |
| 473 | 473 | // Translates a field from the old forum. |
| 474 | 474 | } elseif ( isset( $row['callback_method'] ) ) { |
| 475 | | if ( ( $row['callback_method'] === 'callback_userid' ) && ( false === $this->convert_users ) ) { |
| | 475 | if ( ( 'callback_userid' === $row['callback_method'] ) && ( false === $this->convert_users ) ) { |
| 476 | 476 | $insert_postmeta[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ]; |
| 477 | 477 | } else { |
| 478 | 478 | $insert_postmeta[ $row['to_fieldname'] ] = call_user_func_array( array( $this, $row['callback_method'] ), array( $forum[ $row['from_fieldname'] ], $forum ) ); |
| … |
… |
abstract class BBP_Converter_Base { |
| 489 | 489 | /** Step 3 ************************************************/ |
| 490 | 490 | |
| 491 | 491 | // Something to insert into the destination field |
| 492 | | if ( count( $insert_post ) > 0 || ( $to_type == 'tags' && count( $insert_postmeta ) > 0 ) ) { |
| | 492 | if ( count( $insert_post ) > 0 || ( 'tags' === $to_type && count( $insert_postmeta ) > 0 ) ) { |
| 493 | 493 | |
| 494 | 494 | switch ( $to_type ) { |
| 495 | 495 | |
-
diff --git src/includes/admin/converters/AEF.php src/includes/admin/converters/AEF.php
index 4bebb486..abc29935 100644
|
|
|
class AEF extends BBP_Converter_Base { |
| 587 | 587 | */ |
| 588 | 588 | public function authenticate_pass( $password, $serialized_pass ) { |
| 589 | 589 | $pass_array = unserialize( $serialized_pass ); |
| 590 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 590 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | /** |
-
diff --git src/includes/admin/converters/Drupal7.php src/includes/admin/converters/Drupal7.php
index 54d161ef..6dee1313 100644
|
|
|
class Drupal7 extends BBP_Converter_Base { |
| 585 | 585 | */ |
| 586 | 586 | public function authenticate_pass( $password, $serialized_pass ) { |
| 587 | 587 | $pass_array = unserialize( $serialized_pass ); |
| 588 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 588 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | /** |
-
diff --git src/includes/admin/converters/Example.php src/includes/admin/converters/Example.php
index 4b7c4ecf..df85490a 100644
|
|
|
class Example extends BBP_Converter_Base { |
| 706 | 706 | */ |
| 707 | 707 | public function authenticate_pass( $password, $serialized_pass ) { |
| 708 | 708 | $pass_array = unserialize( $serialized_pass ); |
| 709 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 709 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 710 | 710 | } |
| 711 | 711 | } |
-
diff --git src/includes/admin/converters/FluxBB.php src/includes/admin/converters/FluxBB.php
index 58c5e97c..e9fe9376 100644
|
|
|
class FluxBB extends BBP_Converter_Base { |
| 608 | 608 | */ |
| 609 | 609 | public function authenticate_pass( $password, $serialized_pass ) { |
| 610 | 610 | $pass_array = unserialize( $serialized_pass ); |
| 611 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 611 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | /** |
-
diff --git src/includes/admin/converters/Invision.php src/includes/admin/converters/Invision.php
index 56ae94bd..39ac6b60 100644
|
|
|
class Invision extends BBP_Converter_Base { |
| 482 | 482 | * @return string WordPress safe |
| 483 | 483 | */ |
| 484 | 484 | public function callback_forum_type( $status = 0 ) { |
| 485 | | if ( $status == -1 ) { |
| | 485 | if ( -1 == $status ) { |
| 486 | 486 | $status = 'category'; |
| 487 | 487 | } else { |
| 488 | 488 | $status = 'forum'; |
| … |
… |
class Invision extends BBP_Converter_Base { |
| 536 | 536 | */ |
| 537 | 537 | public function authenticate_pass( $password, $serialized_pass ) { |
| 538 | 538 | $pass_array = unserialize( $serialized_pass ); |
| 539 | | return ( $pass_array['hash'] == md5( md5( $pass_array['salt'] ) . md5( $this->to_char( $password ) ) ) ); |
| | 539 | return ( md5( md5( $pass_array['salt'] ) . md5( $this->to_char( $password ) ) ) == $pass_array['hash'] ); |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | private function to_char( $input ) { |
-
diff --git src/includes/admin/converters/Kunena1.php src/includes/admin/converters/Kunena1.php
index de5bc88f..1c9e43ce 100644
|
|
|
class Kunena1 extends BBP_Converter_Base { |
| 463 | 463 | */ |
| 464 | 464 | public function authenticate_pass($password, $serialized_pass) { |
| 465 | 465 | $pass_array = unserialize($serialized_pass); |
| 466 | | return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) ); |
| | 466 | return ( md5(md5($password) . $pass_array['salt']) == $pass_array['hash'] ); |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
| … |
… |
class Kunena1 extends BBP_Converter_Base { |
| 473 | 473 | * @return string WordPress safe |
| 474 | 474 | */ |
| 475 | 475 | public function callback_forum_type( $status = 0 ) { |
| 476 | | if ( $status == 0 ) { |
| | 476 | if ( 0 == $status ) { |
| 477 | 477 | $status = 'category'; |
| 478 | 478 | } else { |
| 479 | 479 | $status = 'forum'; |
-
diff --git src/includes/admin/converters/Kunena2.php src/includes/admin/converters/Kunena2.php
index ebac4206..61d30cd5 100644
|
|
|
class Kunena2 extends BBP_Converter_Base { |
| 494 | 494 | */ |
| 495 | 495 | public function authenticate_pass($password, $serialized_pass) { |
| 496 | 496 | $pass_array = unserialize($serialized_pass); |
| 497 | | return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) ); |
| | 497 | return ( md5(md5($password) . $pass_array['salt']) == $pass_array['hash'] ); |
| 498 | 498 | } |
| 499 | 499 | /** |
| 500 | 500 | * Translate the forum type from Kunena v2.x numerics to WordPress's strings. |
| … |
… |
class Kunena2 extends BBP_Converter_Base { |
| 503 | 503 | * @return string WordPress safe |
| 504 | 504 | */ |
| 505 | 505 | public function callback_forum_type( $status = 0 ) { |
| 506 | | if ( $status == 0 ) { |
| | 506 | if ( 0 == $status ) { |
| 507 | 507 | $status = 'category'; |
| 508 | 508 | } else { |
| 509 | 509 | $status = 'forum'; |
-
diff --git src/includes/admin/converters/Kunena3.php src/includes/admin/converters/Kunena3.php
index 23bfbd11..4ac8ce75 100644
|
|
|
class Kunena3 extends BBP_Converter_Base { |
| 718 | 718 | */ |
| 719 | 719 | public function authenticate_pass( $password, $serialized_pass ) { |
| 720 | 720 | $pass_array = unserialize( $serialized_pass ); |
| 721 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 721 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 722 | 722 | } |
| 723 | 723 | |
| 724 | 724 | /** |
| … |
… |
class Kunena3 extends BBP_Converter_Base { |
| 728 | 728 | * @return string WordPress safe |
| 729 | 729 | */ |
| 730 | 730 | public function callback_forum_type( $status = 0 ) { |
| 731 | | if ( $status == 0 ) { |
| | 731 | if ( 0 == $status ) { |
| 732 | 732 | $status = 'category'; |
| 733 | 733 | } else { |
| 734 | 734 | $status = 'forum'; |
-
diff --git src/includes/admin/converters/MyBB.php src/includes/admin/converters/MyBB.php
index 4e22ab5c..8cd64de5 100644
|
|
|
class MyBB extends BBP_Converter_Base { |
| 534 | 534 | */ |
| 535 | 535 | public function authenticate_pass( $password, $serialized_pass ) { |
| 536 | 536 | $pass_array = unserialize( $serialized_pass ); |
| 537 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 537 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | /** |
-
diff --git src/includes/admin/converters/PHPFox3.php src/includes/admin/converters/PHPFox3.php
index 4626b395..ac4417ba 100644
|
|
|
class PHPFox3 extends BBP_Converter_Base { |
| 524 | 524 | */ |
| 525 | 525 | public function authenticate_pass( $password, $serialized_pass ) { |
| 526 | 526 | $pass_array = unserialize( $serialized_pass ); |
| 527 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 527 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | /** |
-
diff --git src/includes/admin/converters/PHPWind.php src/includes/admin/converters/PHPWind.php
index e0419ce0..9ea19f01 100644
|
|
|
class PHPWind extends BBP_Converter_Base { |
| 504 | 504 | */ |
| 505 | 505 | public function authenticate_pass( $password, $serialized_pass ) { |
| 506 | 506 | $pass_array = unserialize( $serialized_pass ); |
| 507 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 507 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | /** |
-
diff --git src/includes/admin/converters/Phorum.php src/includes/admin/converters/Phorum.php
index 82a75adb..72cd7563 100644
|
|
|
class Phorum extends BBP_Converter_Base { |
| 534 | 534 | */ |
| 535 | 535 | public function authenticate_pass( $password, $serialized_pass ) { |
| 536 | 536 | $pass_array = unserialize( $serialized_pass ); |
| 537 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 537 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | /** |
-
diff --git src/includes/admin/converters/PunBB.php src/includes/admin/converters/PunBB.php
index 63712f07..76ce903c 100644
|
|
|
class PunBB extends BBP_Converter_Base { |
| 681 | 681 | */ |
| 682 | 682 | public function authenticate_pass( $password, $serialized_pass ) { |
| 683 | 683 | $pass_array = unserialize( $serialized_pass ); |
| 684 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 684 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | /** |
-
diff --git src/includes/admin/converters/SMF.php src/includes/admin/converters/SMF.php
index 8e405683..46e8a293 100644
|
|
|
class SMF extends BBP_Converter_Base { |
| 676 | 676 | */ |
| 677 | 677 | public function authenticate_pass( $password, $serialized_pass ) { |
| 678 | 678 | $pass_array = unserialize( $serialized_pass ); |
| 679 | | return ( $pass_array['hash'] === sha1( strtolower( $pass_array['username'] ) . $password ) ? true : false ); |
| | 679 | return ( sha1( strtolower( $pass_array['username'] ) . $password ) === $pass_array['hash'] ? true : false ); |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | /** |
-
diff --git src/includes/admin/converters/Vanilla.php src/includes/admin/converters/Vanilla.php
index 8f18b6b6..1021f16f 100644
|
|
|
class Vanilla extends BBP_Converter_Base { |
| 571 | 571 | * @return int |
| 572 | 572 | */ |
| 573 | 573 | public function callback_forum_parent( $parent = 0 ) { |
| 574 | | if ( $parent == -1 ) { |
| | 574 | if ( -1 == $parent ) { |
| 575 | 575 | return 0; |
| 576 | 576 | } else { |
| 577 | 577 | return $parent; |
-
diff --git src/includes/admin/converters/XMB.php src/includes/admin/converters/XMB.php
index eb1fdce0..9ece8d03 100644
|
|
|
class XMB extends BBP_Converter_Base { |
| 641 | 641 | */ |
| 642 | 642 | public function authenticate_pass( $password, $serialized_pass ) { |
| 643 | 643 | $pass_array = unserialize( $serialized_pass ); |
| 644 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 644 | return ( md5( md5( $password ). $pass_array['salt'] == $pass_array['hash'] ) ); |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | /** |
-
diff --git src/includes/admin/converters/XenForo.php src/includes/admin/converters/XenForo.php
index 834c5268..fb12b427 100644
|
|
|
class XenForo extends BBP_Converter_Base { |
| 699 | 699 | $pass_array = unserialize( $serialized_pass ); |
| 700 | 700 | switch ( $pass_array['hashFunc'] ) { |
| 701 | 701 | case 'sha256': |
| 702 | | return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) ); |
| | 702 | return ( hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) == $pass_array['hash'] ); |
| 703 | 703 | case 'sha1': |
| 704 | | return ( $pass_array['hash'] == sha1( sha1( $password ) . $pass_array['salt'] ) ); |
| | 704 | return ( sha1( sha1( $password ) . $pass_array['salt'] ) == $pass_array['hash'] ); |
| 705 | 705 | } |
| 706 | 706 | } |
| 707 | 707 | |
-
diff --git src/includes/admin/converters/bbPress1.php src/includes/admin/converters/bbPress1.php
index fe202662..8c455a45 100644
|
|
|
class bbPress1 extends BBP_Converter_Base { |
| 661 | 661 | * @return string WordPress safe |
| 662 | 662 | */ |
| 663 | 663 | public function callback_forum_type( $status = 0 ) { |
| 664 | | if ( $status == 1 ) { |
| | 664 | if ( 1 == $status ) { |
| 665 | 665 | $status = 'category'; |
| 666 | 666 | } else { |
| 667 | 667 | $status = 'forum'; |
-
diff --git src/includes/admin/converters/e107v1.php src/includes/admin/converters/e107v1.php
index efc971a1..d4938e25 100644
|
|
|
class e107v1 extends BBP_Converter_Base { |
| 489 | 489 | */ |
| 490 | 490 | public function authenticate_pass( $password, $serialized_pass ) { |
| 491 | 491 | $pass_array = unserialize( $serialized_pass ); |
| 492 | | return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); |
| | 492 | return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] ); |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | /** |
| … |
… |
class e107v1 extends BBP_Converter_Base { |
| 499 | 499 | * @return string WordPress safe |
| 500 | 500 | */ |
| 501 | 501 | public function callback_forum_type( $status = 0 ) { |
| 502 | | if ( $status == 0 ) { |
| | 502 | if ( 0 == $status ) { |
| 503 | 503 | $status = 'category'; |
| 504 | 504 | } else { |
| 505 | 505 | $status = 'forum'; |
-
diff --git src/includes/admin/converters/vBulletin.php src/includes/admin/converters/vBulletin.php
index d2664745..55fcb977 100644
|
|
|
class vBulletin extends BBP_Converter_Base { |
| 651 | 651 | */ |
| 652 | 652 | public function authenticate_pass( $password, $serialized_pass ) { |
| 653 | 653 | $pass_array = unserialize( $serialized_pass ); |
| 654 | | return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) ); |
| | 654 | return ( md5( md5( $password ) . $pass_array['salt'] ) == $pass_array['hash'] ); |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | /** |
| … |
… |
class vBulletin extends BBP_Converter_Base { |
| 661 | 661 | * @return string WordPress safe |
| 662 | 662 | */ |
| 663 | 663 | public function callback_forum_type( $status = 0 ) { |
| 664 | | if ( $status == -1 ) { |
| | 664 | if ( -1 == $status ) { |
| 665 | 665 | $status = 'category'; |
| 666 | 666 | } else { |
| 667 | 667 | $status = 'forum'; |
-
diff --git src/includes/admin/converters/vBulletin3.php src/includes/admin/converters/vBulletin3.php
index e325bac1..d80e84f8 100644
|
|
|
class vBulletin3 extends BBP_Converter_Base { |
| 655 | 655 | */ |
| 656 | 656 | public function authenticate_pass( $password, $serialized_pass ) { |
| 657 | 657 | $pass_array = unserialize( $serialized_pass ); |
| 658 | | return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) ); |
| | 658 | return ( md5( md5( $password ) . $pass_array['salt'] ) == $pass_array['hash'] ); |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | /** |
| … |
… |
class vBulletin3 extends BBP_Converter_Base { |
| 665 | 665 | * @return string WordPress safe |
| 666 | 666 | */ |
| 667 | 667 | public function callback_forum_type( $status = 0 ) { |
| 668 | | if ( $status == -1 ) { |
| | 668 | if ( -1 == $status ) { |
| 669 | 669 | $status = 'category'; |
| 670 | 670 | } else { |
| 671 | 671 | $status = 'forum'; |
-
diff --git src/includes/admin/forums.php src/includes/admin/forums.php
index 54ad64e6..965380ff 100644
|
|
|
class BBP_Forums_Admin { |
| 447 | 447 | |
| 448 | 448 | switch ( $notice ) { |
| 449 | 449 | case 'opened' : |
| 450 | | $message = ( $is_failure === true ) |
| | 450 | $message = ( true === $is_failure ) |
| 451 | 451 | ? sprintf( esc_html__( 'There was a problem opening the forum "%1$s".', 'bbpress' ), $forum_title ) |
| 452 | 452 | : sprintf( esc_html__( 'Forum "%1$s" successfully opened.', 'bbpress' ), $forum_title ); |
| 453 | 453 | break; |
| 454 | 454 | |
| 455 | 455 | case 'closed' : |
| 456 | | $message = ( $is_failure === true ) |
| | 456 | $message = ( true === $is_failure ) |
| 457 | 457 | ? sprintf( esc_html__( 'There was a problem closing the forum "%1$s".', 'bbpress' ), $forum_title ) |
| 458 | 458 | : sprintf( esc_html__( 'Forum "%1$s" successfully closed.', 'bbpress' ), $forum_title ); |
| 459 | 459 | break; |
| … |
… |
class BBP_Forums_Admin { |
| 461 | 461 | |
| 462 | 462 | // Do additional forum toggle notice filters (admin side) |
| 463 | 463 | $message = apply_filters( 'bbp_toggle_forum_notice_admin', $message, $forum_id, $notice, $is_failure ); |
| 464 | | $class = ( $is_failure === true ) |
| | 464 | $class = ( true === $is_failure ) |
| 465 | 465 | ? 'error' |
| 466 | 466 | : 'updated'; |
| 467 | 467 | |
-
diff --git src/includes/admin/replies.php src/includes/admin/replies.php
index c294373e..250797db 100644
|
|
|
class BBP_Replies_Admin { |
| 421 | 421 | // Get reply author data |
| 422 | 422 | $anonymous_data = bbp_filter_anonymous_post_data(); |
| 423 | 423 | $author_id = bbp_get_reply_author_id( $reply_id ); |
| 424 | | $is_edit = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) ); |
| | 424 | $is_edit = ( isset( $_POST['hidden_post_status'] ) && ( 'draft' !== $_POST['hidden_post_status'] ) ); |
| 425 | 425 | |
| 426 | 426 | // Formally update the reply |
| 427 | 427 | bbp_update_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $author_id, $is_edit, $reply_to ); |
| … |
… |
class BBP_Replies_Admin { |
| 558 | 558 | |
| 559 | 559 | switch ( $notice ) { |
| 560 | 560 | case 'spammed' : |
| 561 | | $message = ( $is_failure === true ) |
| | 561 | $message = ( true === $is_failure ) |
| 562 | 562 | ? sprintf( esc_html__( 'There was a problem marking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) |
| 563 | 563 | : sprintf( esc_html__( 'Reply "%1$s" successfully marked as spam.', 'bbpress' ), $reply_title ); |
| 564 | 564 | break; |
| 565 | 565 | |
| 566 | 566 | case 'unspammed' : |
| 567 | | $message = ( $is_failure === true ) |
| | 567 | $message = ( true === $is_failure ) |
| 568 | 568 | ? sprintf( esc_html__( 'There was a problem unmarking the reply "%1$s" as spam.', 'bbpress' ), $reply_title ) |
| 569 | 569 | : sprintf( esc_html__( 'Reply "%1$s" successfully unmarked as spam.', 'bbpress' ), $reply_title ); |
| 570 | 570 | break; |
| 571 | 571 | |
| 572 | 572 | case 'approved' : |
| 573 | | $message = ( $is_failure === true ) |
| | 573 | $message = ( true === $is_failure ) |
| 574 | 574 | ? sprintf( esc_html__( 'There was a problem approving the reply "%1$s".', 'bbpress' ), $reply_title ) |
| 575 | 575 | : sprintf( esc_html__( 'Reply "%1$s" successfully approved.', 'bbpress' ), $reply_title ); |
| 576 | 576 | break; |
| 577 | 577 | |
| 578 | 578 | case 'unapproved' : |
| 579 | | $message = ( $is_failure === true ) |
| | 579 | $message = ( true === $is_failure ) |
| 580 | 580 | ? sprintf( esc_html__( 'There was a problem unapproving the reply "%1$s".', 'bbpress' ), $reply_title ) |
| 581 | 581 | : sprintf( esc_html__( 'Reply "%1$s" successfully unapproved.', 'bbpress' ), $reply_title ); |
| 582 | 582 | break; |
| … |
… |
class BBP_Replies_Admin { |
| 584 | 584 | |
| 585 | 585 | // Do additional reply toggle notice filters (admin side) |
| 586 | 586 | $message = apply_filters( 'bbp_toggle_reply_notice_admin', $message, $reply_id, $notice, $is_failure ); |
| 587 | | $class = ( $is_failure === true ) |
| | 587 | $class = ( true === $is_failure ) |
| 588 | 588 | ? 'error' |
| 589 | 589 | : 'updated'; |
| 590 | 590 | |
-
diff --git src/includes/admin/tools/repair.php src/includes/admin/tools/repair.php
index 4504edfc..4638e7cd 100644
|
|
|
function bbp_admin_repair_sticky() { |
| 1066 | 1066 | |
| 1067 | 1067 | // If the topic is not a super sticky, and the forum ID does not |
| 1068 | 1068 | // match the topic's forum ID, unset the forum's sticky meta. |
| 1069 | | if ( ! bbp_is_topic_super_sticky( $topic_id ) && ( $forum_id !== bbp_get_topic_forum_id( $topic_id ) ) ) { |
| | 1069 | if ( ! bbp_is_topic_super_sticky( $topic_id ) && ( bbp_get_topic_forum_id( $topic_id ) ) !== $forum_id ) { |
| 1070 | 1070 | unset( $forum_stickies[ $forum_id ][ $id ] ); |
| 1071 | 1071 | } |
| 1072 | 1072 | } |
-
diff --git src/includes/admin/topics.php src/includes/admin/topics.php
index def70dd2..8fcc27aa 100644
|
|
|
class BBP_Topics_Admin { |
| 538 | 538 | // Get topic author data |
| 539 | 539 | $anonymous_data = bbp_filter_anonymous_post_data(); |
| 540 | 540 | $author_id = bbp_get_topic_author_id( $topic_id ); |
| 541 | | $is_edit = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) ); |
| | 541 | $is_edit = ( isset( $_POST['hidden_post_status'] ) && ( 'draft' !== $_POST['hidden_post_status'] ) ); |
| 542 | 542 | |
| 543 | 543 | // Formally update the topic |
| 544 | 544 | bbp_update_topic( $topic_id, $forum_id, $anonymous_data, $author_id, $is_edit ); |
| … |
… |
class BBP_Topics_Admin { |
| 709 | 709 | // Which notice? |
| 710 | 710 | switch ( $notice ) { |
| 711 | 711 | case 'opened' : |
| 712 | | $message = ( $is_failure === true ) |
| | 712 | $message = ( true === $is_failure ) |
| 713 | 713 | ? sprintf( esc_html__( 'There was a problem opening the topic "%1$s".', 'bbpress' ), $topic_title ) |
| 714 | 714 | : sprintf( esc_html__( 'Topic "%1$s" successfully opened.', 'bbpress' ), $topic_title ); |
| 715 | 715 | break; |
| 716 | 716 | |
| 717 | 717 | case 'closed' : |
| 718 | | $message = ( $is_failure === true ) |
| | 718 | $message = ( true === $is_failure ) |
| 719 | 719 | ? sprintf( esc_html__( 'There was a problem closing the topic "%1$s".', 'bbpress' ), $topic_title ) |
| 720 | 720 | : sprintf( esc_html__( 'Topic "%1$s" successfully closed.', 'bbpress' ), $topic_title ); |
| 721 | 721 | break; |
| 722 | 722 | |
| 723 | 723 | case 'super_sticky' : |
| 724 | | $message = ( $is_failure === true ) |
| | 724 | $message = ( true === $is_failure ) |
| 725 | 725 | ? sprintf( esc_html__( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title ) |
| 726 | 726 | : sprintf( esc_html__( 'Topic "%1$s" successfully stuck to front.', 'bbpress' ), $topic_title ); |
| 727 | 727 | break; |
| 728 | 728 | |
| 729 | 729 | case 'stuck' : |
| 730 | | $message = ( $is_failure === true ) |
| | 730 | $message = ( true === $is_failure ) |
| 731 | 731 | ? sprintf( esc_html__( 'There was a problem sticking the topic "%1$s".', 'bbpress' ), $topic_title ) |
| 732 | 732 | : sprintf( esc_html__( 'Topic "%1$s" successfully stuck.', 'bbpress' ), $topic_title ); |
| 733 | 733 | break; |
| 734 | 734 | |
| 735 | 735 | case 'unstuck' : |
| 736 | | $message = ( $is_failure === true ) |
| | 736 | $message = ( true === $is_failure ) |
| 737 | 737 | ? sprintf( esc_html__( 'There was a problem unsticking the topic "%1$s".', 'bbpress' ), $topic_title ) |
| 738 | 738 | : sprintf( esc_html__( 'Topic "%1$s" successfully unstuck.', 'bbpress' ), $topic_title ); |
| 739 | 739 | break; |
| 740 | 740 | |
| 741 | 741 | case 'spammed' : |
| 742 | | $message = ( $is_failure === true ) |
| | 742 | $message = ( true === $is_failure ) |
| 743 | 743 | ? sprintf( esc_html__( 'There was a problem marking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) |
| 744 | 744 | : sprintf( esc_html__( 'Topic "%1$s" successfully marked as spam.', 'bbpress' ), $topic_title ); |
| 745 | 745 | break; |
| 746 | 746 | |
| 747 | 747 | case 'unspammed' : |
| 748 | | $message = ( $is_failure === true ) |
| | 748 | $message = ( true === $is_failure ) |
| 749 | 749 | ? sprintf( esc_html__( 'There was a problem unmarking the topic "%1$s" as spam.', 'bbpress' ), $topic_title ) |
| 750 | 750 | : sprintf( esc_html__( 'Topic "%1$s" successfully unmarked as spam.', 'bbpress' ), $topic_title ); |
| 751 | 751 | break; |
| 752 | 752 | |
| 753 | 753 | case 'approved' : |
| 754 | | $message = ( $is_failure === true ) |
| | 754 | $message = ( true === $is_failure ) |
| 755 | 755 | ? sprintf( esc_html__( 'There was a problem approving the topic "%1$s".', 'bbpress' ), $topic_title ) |
| 756 | 756 | : sprintf( esc_html__( 'Topic "%1$s" successfully approved.', 'bbpress' ), $topic_title ); |
| 757 | 757 | break; |
| 758 | 758 | |
| 759 | 759 | case 'unapproved' : |
| 760 | | $message = ( $is_failure === true ) |
| | 760 | $message = ( true === $is_failure ) |
| 761 | 761 | ? sprintf( esc_html__( 'There was a problem unapproving the topic "%1$s".', 'bbpress' ), $topic_title ) |
| 762 | 762 | : sprintf( esc_html__( 'Topic "%1$s" successfully unapproved.', 'bbpress' ), $topic_title ); |
| 763 | 763 | break; |
| … |
… |
class BBP_Topics_Admin { |
| 765 | 765 | |
| 766 | 766 | // Do additional topic toggle notice filters (admin side) |
| 767 | 767 | $message = apply_filters( 'bbp_toggle_topic_notice_admin', $message, $topic_id, $notice, $is_failure ); |
| 768 | | $class = ( $is_failure === true ) |
| | 768 | $class = ( true === $is_failure ) |
| 769 | 769 | ? 'error' |
| 770 | 770 | : 'updated'; |
| 771 | 771 | |
-
diff --git src/includes/common/formatting.php src/includes/common/formatting.php
index 0f9ff4f1..746f89c1 100644
|
|
|
function bbp_make_clickable( $text = '' ) { |
| 368 | 368 | $nested_code_pre--; |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | | if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) { |
| | 371 | if ( $nested_code_pre || empty( $piece ) || ( '<' === $piece[0] && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) { |
| 372 | 372 | $r .= $piece; |
| 373 | 373 | continue; |
| 374 | 374 | } |
-
diff --git src/includes/common/locks.php src/includes/common/locks.php
index 49558e86..0d3945fb 100644
|
|
|
function bbp_check_post_lock( $post_id = 0 ) { |
| 43 | 43 | $time_window = apply_filters( 'bbp_check_post_lock_window', 3 * MINUTE_IN_SECONDS ); |
| 44 | 44 | |
| 45 | 45 | // Return user who is or last edited |
| 46 | | if ( ! empty( $time ) && ( $time > ( time() - $time_window ) ) && ( $user !== bbp_get_current_user_id() ) ) { |
| | 46 | if ( ! empty( $time ) && ( $time > ( time() - $time_window ) ) && ( bbp_get_current_user_id() ) !== $user ) { |
| 47 | 47 | return (int) $user; |
| 48 | 48 | } |
| 49 | 49 | |
-
diff --git src/includes/common/template.php src/includes/common/template.php
index 12467827..9babd75e 100644
|
|
|
function bbp_is_forum_edit() { |
| 193 | 193 | $wp_query = bbp_get_wp_query(); |
| 194 | 194 | |
| 195 | 195 | // Check query |
| 196 | | if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) ) { |
| | 196 | if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( true === $wp_query->bbp_is_forum_edit ) ) { |
| 197 | 197 | $retval = true; |
| 198 | 198 | |
| 199 | 199 | // Editing in admin |
| … |
… |
function bbp_is_topic_edit() { |
| 291 | 291 | $wp_query = bbp_get_wp_query(); |
| 292 | 292 | |
| 293 | 293 | // Check query |
| 294 | | if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) ) { |
| | 294 | if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( true === $wp_query->bbp_is_topic_edit ) ) { |
| 295 | 295 | $retval = true; |
| 296 | 296 | |
| 297 | 297 | // Editing in admin |
| … |
… |
function bbp_is_edit() { |
| 948 | 948 | $wp_query = bbp_get_wp_query(); |
| 949 | 949 | |
| 950 | 950 | // Check query |
| 951 | | if ( ! empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) ) { |
| | 951 | if ( ! empty( $wp_query->bbp_is_edit ) && ( true === $wp_query->bbp_is_edit ) ) { |
| 952 | 952 | $retval = true; |
| 953 | 953 | } |
| 954 | 954 | |
| … |
… |
function bbp_breadcrumb( $args = array() ) { |
| 2308 | 2308 | } |
| 2309 | 2309 | |
| 2310 | 2310 | // Don't show root if viewing page in place of forum archive |
| 2311 | | if ( ! empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id === get_the_ID() ) ) ) { |
| | 2311 | if ( ! empty( $root_id ) && ( ( is_single() || is_page() ) && ( get_the_ID() === $root_id ) ) ) { |
| 2312 | 2312 | $pre_include_root = false; |
| 2313 | 2313 | } |
| 2314 | 2314 | |
-
diff --git src/includes/core/abstraction.php src/includes/core/abstraction.php
index 25f54a4e..8945bbc0 100644
|
|
|
function bbp_maybe_intercept( $action = '', $args = array() ) { |
| 471 | 471 | $filtered = call_user_func_array( 'apply_filters', $args ); |
| 472 | 472 | |
| 473 | 473 | // Return filtered value, or default if not intercepted |
| 474 | | return ( $filtered === reset( $r ) ) |
| | 474 | return ( reset( $r ) === $filtered ) |
| 475 | 475 | ? $default |
| 476 | 476 | : $filtered; |
| 477 | 477 | } |
-
diff --git src/includes/core/update.php src/includes/core/update.php
index 7b2997ec..bd331649 100644
|
|
|
function bbp_is_activation( $basename = '' ) { |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // The plugin(s) being activated |
| 71 | | if ( $action === 'activate' ) { |
| | 71 | if ( 'activate' === $action ) { |
| 72 | 72 | $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); |
| 73 | 73 | } else { |
| 74 | 74 | $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); |
| … |
… |
function bbp_is_deactivation( $basename = '' ) { |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | // The plugin(s) being deactivated |
| 121 | | if ( $action === 'deactivate' ) { |
| | 121 | if ( 'deactivate' === $action ) { |
| 122 | 122 | $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); |
| 123 | 123 | } else { |
| 124 | 124 | $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); |
-
diff --git src/includes/extend/akismet.php src/includes/extend/akismet.php
index 1617ae6a..bcd05c78 100644
|
|
|
class BBP_Akismet { |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | // Normal result: true |
| 598 | | if ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( $this->last_post['bbp_akismet_result'] === 'true' ) ) { |
| | 598 | if ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( 'true' === $this->last_post['bbp_akismet_result'] ) ) { |
| 599 | 599 | |
| 600 | 600 | // Leave a trail so other's know what we did |
| 601 | 601 | update_post_meta( $post_id, '_bbp_akismet_result', 'true' ); |
| … |
… |
class BBP_Akismet { |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | // Normal result: false |
| 621 | | } elseif ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( $this->last_post['bbp_akismet_result'] === 'false' ) ) { |
| | 621 | } elseif ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( 'false' === $this->last_post['bbp_akismet_result'] ) ) { |
| 622 | 622 | |
| 623 | 623 | // Leave a trail so other's know what we did |
| 624 | 624 | update_post_meta( $post_id, '_bbp_akismet_result', 'false' ); |
-
diff --git src/includes/forums/functions.php src/includes/forums/functions.php
index fa54e9d8..a459410f 100644
|
|
|
function bbp_new_forum_handler( $action = '' ) { |
| 292 | 292 | |
| 293 | 293 | // If the forum is trash, or the forum_status is switched to |
| 294 | 294 | // trash, trash it properly |
| 295 | | if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $forum_data['post_status'] === bbp_get_trash_status_id() ) ) { |
| | 295 | if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( bbp_get_trash_status_id() === $forum_data['post_status'] ) ) { |
| 296 | 296 | |
| 297 | 297 | // Trash the reply |
| 298 | 298 | wp_trash_post( $forum_id ); |
| … |
… |
function bbp_new_forum_handler( $action = '' ) { |
| 304 | 304 | /** Spam Check ********************************************************/ |
| 305 | 305 | |
| 306 | 306 | // If reply or forum are spam, officially spam this reply |
| 307 | | if ( $forum_data['post_status'] === bbp_get_spam_status_id() ) { |
| | 307 | if ( bbp_get_spam_status_id() === $forum_data['post_status'] ) { |
| 308 | 308 | add_post_meta( $forum_id, '_bbp_spam_meta_status', bbp_get_public_status_id() ); |
| 309 | 309 | |
| 310 | 310 | // Force view=all |
-
diff --git src/includes/forums/template.php src/includes/forums/template.php
index a9eefdca..20316b92 100644
|
|
|
function bbp_get_forum( $forum, $output = OBJECT, $filter = 'raw' ) { |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | // Bail if not correct post type |
| 296 | | if ( $forum->post_type !== bbp_get_forum_post_type() ) { |
| | 296 | if ( bbp_get_forum_post_type() !== $forum->post_type ) { |
| 297 | 297 | return null; |
| 298 | 298 | } |
| 299 | 299 | |
| … |
… |
function bbp_get_forum( $forum, $output = OBJECT, $filter = 'raw' ) { |
| 301 | 301 | $retval = $forum; |
| 302 | 302 | |
| 303 | 303 | // Array A |
| 304 | | if ( $output === ARRAY_A ) { |
| | 304 | if ( ARRAY_A === $output ) { |
| 305 | 305 | $retval = get_object_vars( $forum ); |
| 306 | 306 | |
| 307 | 307 | // Array N |
| 308 | | } elseif ( $output === ARRAY_N ) { |
| | 308 | } elseif ( ARRAY_N === $output ) { |
| 309 | 309 | $retval = array_values( get_object_vars( $forum ) ); |
| 310 | 310 | } |
| 311 | 311 | |
| … |
… |
function bbp_is_forum_status( $forum_id, $status_name, $check_ancestors = true, |
| 1599 | 1599 | } |
| 1600 | 1600 | |
| 1601 | 1601 | // Break when it reach the max count |
| 1602 | | if ( ( $operator === 'OR' ) && ( $count >= 1 ) ) { |
| | 1602 | if ( ( 'OR' === $operator ) && ( $count >= 1 ) ) { |
| 1603 | 1603 | break; |
| 1604 | 1604 | } |
| 1605 | 1605 | } |
| … |
… |
function bbp_is_forum_visibility( $forum_id, $status_name, $check_ancestors = tr |
| 1736 | 1736 | } |
| 1737 | 1737 | |
| 1738 | 1738 | // Break when it reach the max count |
| 1739 | | if ( ( $operator === 'OR' ) && ( $count >= 1 ) ) { |
| | 1739 | if ( ( 'OR' === $operator ) && ( $count >= 1 ) ) { |
| 1740 | 1740 | break; |
| 1741 | 1741 | } |
| 1742 | 1742 | } |
-
diff --git src/includes/replies/functions.php src/includes/replies/functions.php
index 220d6380..55180be5 100644
|
|
|
function bbp_new_reply_handler( $action = '' ) { |
| 412 | 412 | |
| 413 | 413 | // If this reply starts as trash, add it to pre_trashed_replies |
| 414 | 414 | // for the topic, so it is properly restored. |
| 415 | | if ( bbp_is_topic_trash( $topic_id ) || ( $reply_data['post_status'] === bbp_get_trash_status_id() ) ) { |
| | 415 | if ( bbp_is_topic_trash( $topic_id ) || ( bbp_get_trash_status_id() === $reply_data['post_status'] ) ) { |
| 416 | 416 | |
| 417 | 417 | // Trash the reply |
| 418 | 418 | wp_trash_post( $reply_id ); |
| … |
… |
function bbp_new_reply_handler( $action = '' ) { |
| 438 | 438 | /** Spam Check ********************************************************/ |
| 439 | 439 | |
| 440 | 440 | // If reply or topic are spam, officially spam this reply |
| 441 | | } elseif ( bbp_is_topic_spam( $topic_id ) || ( $reply_data['post_status'] === bbp_get_spam_status_id() ) ) { |
| | 441 | } elseif ( bbp_is_topic_spam( $topic_id ) || ( bbp_get_spam_status_id() === $reply_data['post_status'] ) ) { |
| 442 | 442 | add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() ); |
| 443 | 443 | |
| 444 | 444 | // Only add to pre-spammed array if topic is spam |
| … |
… |
function bbp_edit_reply_handler( $action = '' ) { |
| 579 | 579 | $forum_id = bbp_get_topic_forum_id( $topic_id ); |
| 580 | 580 | |
| 581 | 581 | // Forum exists |
| 582 | | if ( ! empty( $forum_id ) && ( $forum_id !== bbp_get_reply_forum_id( $reply_id ) ) ) { |
| | 582 | if ( ! empty( $forum_id ) && ( bbp_get_reply_forum_id( $reply_id ) !== $forum_id ) ) { |
| 583 | 583 | |
| 584 | 584 | // Forum is a category |
| 585 | 585 | if ( bbp_is_forum_category( $forum_id ) ) { |
-
diff --git src/includes/replies/template.php src/includes/replies/template.php
index 0d12854d..f95dd95b 100644
|
|
|
function bbp_get_reply( $reply, $output = OBJECT, $filter = 'raw' ) { |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | // Bail if not correct post type |
| 369 | | if ( $reply->post_type !== bbp_get_reply_post_type() ) { |
| | 369 | if ( bbp_get_reply_post_type() !== $reply->post_type ) { |
| 370 | 370 | return null; |
| 371 | 371 | } |
| 372 | 372 | |
| … |
… |
function bbp_get_reply( $reply, $output = OBJECT, $filter = 'raw' ) { |
| 374 | 374 | $retval = $reply; |
| 375 | 375 | |
| 376 | 376 | // Array A |
| 377 | | if ( $output === ARRAY_A ) { |
| | 377 | if ( ARRAY_A === $output ) { |
| 378 | 378 | $retval = get_object_vars( $reply ); |
| 379 | 379 | |
| 380 | 380 | // Array N |
| 381 | | } elseif ( $output === ARRAY_N ) { |
| | 381 | } elseif ( ARRAY_N === $output ) { |
| 382 | 382 | $retval = array_values( get_object_vars( $reply ) ); |
| 383 | 383 | } |
| 384 | 384 | |
-
diff --git src/includes/topics/functions.php src/includes/topics/functions.php
index 823b6acf..0e241bb8 100644
|
|
|
function bbp_new_topic_handler( $action = '' ) { |
| 342 | 342 | /** Close Check *******************************************************/ |
| 343 | 343 | |
| 344 | 344 | // If the topic is closed, close it properly |
| 345 | | if ( ( get_post_field( 'post_status', $topic_id ) === bbp_get_closed_status_id() ) || ( $topic_data['post_status'] === bbp_get_closed_status_id() ) ) { |
| | 345 | if ( ( get_post_field( 'post_status', $topic_id ) === bbp_get_closed_status_id() ) || bbp_get_closed_status_id() === ( $topic_data['post_status'] ) ) { |
| 346 | 346 | |
| 347 | 347 | // Close the topic |
| 348 | 348 | bbp_close_topic( $topic_id ); |
| … |
… |
function bbp_new_topic_handler( $action = '' ) { |
| 352 | 352 | |
| 353 | 353 | // If the forum is trash, or the topic_status is switched to |
| 354 | 354 | // trash, trash the topic properly |
| 355 | | if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $topic_data['post_status'] === bbp_get_trash_status_id() ) ) { |
| | 355 | if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || bbp_get_trash_status_id() === ( $topic_data['post_status'] ) ) { |
| 356 | 356 | |
| 357 | 357 | // Trash the topic |
| 358 | 358 | wp_trash_post( $topic_id ); |
| … |
… |
function bbp_new_topic_handler( $action = '' ) { |
| 364 | 364 | /** Spam Check ********************************************************/ |
| 365 | 365 | |
| 366 | 366 | // If the topic is spam, officially spam this topic |
| 367 | | if ( $topic_data['post_status'] === bbp_get_spam_status_id() ) { |
| | 367 | if ( bbp_get_spam_status_id() === $topic_data['post_status'] ) { |
| 368 | 368 | add_post_meta( $topic_id, '_bbp_spam_meta_status', bbp_get_public_status_id() ); |
| 369 | 369 | |
| 370 | 370 | // Force view=all |
-
diff --git src/includes/topics/template.php src/includes/topics/template.php
index 19db3504..c4edafb6 100644
|
|
|
function bbp_get_topic( $topic, $output = OBJECT, $filter = 'raw' ) { |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | // Bail if not correct post type |
| 525 | | if ( $topic->post_type !== bbp_get_topic_post_type() ) { |
| | 525 | if ( bbp_get_topic_post_type() !== $topic->post_type ) { |
| 526 | 526 | return null; |
| 527 | 527 | } |
| 528 | 528 | |
| … |
… |
function bbp_get_topic( $topic, $output = OBJECT, $filter = 'raw' ) { |
| 530 | 530 | $retval = $topic; |
| 531 | 531 | |
| 532 | 532 | // Array A |
| 533 | | if ( $output === ARRAY_A ) { |
| | 533 | if ( ARRAY_A === $output ) { |
| 534 | 534 | $retval = get_object_vars( $topic ); |
| 535 | 535 | |
| 536 | 536 | // Array N |
| 537 | | } elseif ( $output === ARRAY_N ) { |
| | 537 | } elseif ( ARRAY_N === $output ) { |
| 538 | 538 | $retval = array_values( get_object_vars( $topic ) ); |
| 539 | 539 | } |
| 540 | 540 | |
-
diff --git src/includes/users/template.php src/includes/users/template.php
index 965c4318..65b1e8a1 100644
|
|
|
class BBP_User_Query extends WP_User_Query { |
| 100 | 100 | $this->in_the_loop = true; |
| 101 | 101 | |
| 102 | 102 | // loop has just started |
| 103 | | if ( $this->current_user === -1 ) { |
| | 103 | if ( -1 === $this->current_user ) { |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * Fires once the loop is started. |